home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Technology Seed / August 1998 ADC Seed CD.toast / Mac OS 8.5b2 / allegro-b2-pseudo-SDK / AIncludes / Controls.a < prev    next >
Encoding:
Text File  |  1998-07-17  |  92.6 KB  |  2,363 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Controls.a
  3. ;
  4. ;    Contains:    Control Manager interfaces
  5. ;
  6. ;    Version:    Technology:    Mac OS 8.1
  7. ;                Release:    Allego Seed, Use with 3.1 Universal Interfaces
  8. ;
  9. ;    Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__CONTROLS__') = 'UNDEFINED' THEN
  19. __CONTROLS__ SET 1
  20.  
  21.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  22.     include 'MacTypes.a'
  23.     ENDIF
  24.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  25.     include 'Quickdraw.a'
  26.     ENDIF
  27.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  28.     include 'Menus.a'
  29.     ENDIF
  30.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  31.     include 'TextEdit.a'
  32.     ENDIF
  33.     IF &TYPE('__DRAG__') = 'UNDEFINED' THEN
  34.     include 'Drag.a'
  35.     ENDIF
  36.     IF &TYPE('__ICONS__') = 'UNDEFINED' THEN
  37.     include 'Icons.a'
  38.     ENDIF
  39.  
  40.  
  41. _ControlDispatch                EQU        $AA73
  42.  
  43. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  44. ;     • Gestalt                                                                                            
  45. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  46.  
  47. gestaltControlMgrAttr            EQU        'cntl'
  48. gestaltControlMgrPresent        EQU        $00000001
  49. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  50. ;     • Resource Types                                                                                    
  51. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  52.  
  53. kControlDefProcType                EQU        'CDEF'
  54. kControlTemplateResourceType    EQU        'CNTL'
  55. kControlColorTableResourceType    EQU        'cctb'
  56. kControlDefProcResourceType        EQU        'CDEF'
  57. kControlTabListResType            EQU        'tab#'                ; used for tab control (Appearance 1.0 and later)
  58. kControlListDescResType            EQU        'ldes'                ; used for list box control (Appearance 1.0 and later)
  59. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  60. ;     • Format of a ‘CNTL’ resource                                                                        
  61. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  62. ControlTemplate            RECORD 0
  63. controlRect                 ds        Rect            ; offset: $0 (0)
  64. controlValue             ds.w    1                ; offset: $8 (8)
  65. controlVisible             ds.b    1                ; offset: $A (10)
  66. fill                     ds.b    1                ; offset: $B (11)
  67. controlMaximum             ds.w    1                ; offset: $C (12)
  68. controlMinimum             ds.w    1                ; offset: $E (14)
  69. controlDefProcID         ds.w    1                ; offset: $10 (16)
  70. controlReference         ds.l    1                ; offset: $12 (18)
  71. controlTitle             ds        Str255            ; offset: $16 (22)
  72. sizeof                     EQU *                    ; size:   $116 (278)
  73.                         ENDR
  74. ; typedef struct ControlTemplate *        ControlTemplatePtr
  75.  
  76. ; typedef ControlTemplatePtr *            ControlTemplateHandle
  77.  
  78.  
  79.  
  80.     IF ¬ TARGET_OS_MAC THEN
  81.  
  82. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  83. ;   • NON-MAC COMPATIBILITY CODES (QuickTime 3.0)
  84. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  85.  
  86.  
  87. ; typedef UInt32                         ControlNotification
  88.  
  89.  
  90. controlNotifyNothing            EQU        'nada'                ; No (null) notification
  91. controlNotifyClick                EQU        'clik'                ; Control was clicked
  92. controlNotifyFocus                EQU        'focu'                ; Control got keyboard focus
  93. controlNotifyKey                EQU        'key '                ; Control got a keypress
  94. ; typedef UInt32                         ControlCapabilities
  95.  
  96.  
  97. kControlCanAutoInvalidate        EQU        $00000001            ; Control component automatically invalidates areas left behind after hide/move operation.
  98. ;  procID's for our added "controls"
  99.  
  100. staticTextProc                    EQU        256                    ; static text
  101. editTextProc                    EQU        272                    ; editable text
  102. iconProc                        EQU        288                    ; icon
  103. userItemProc                    EQU        304                    ; user drawn item
  104. pictItemProc                    EQU        320                    ; pict
  105.     ENDIF
  106. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  107. ;     • ControlHandle                                                                                        
  108. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  109.  
  110.  
  111. ; typedef ControlRecord *                ControlPtr
  112.  
  113. ; typedef ControlPtr *                    ControlHandle
  114.  
  115. ;  ControlRef is obsolete. Use ControlHandle.
  116. ; typedef ControlHandle                 ControlRef
  117.  
  118. ; typedef SInt16                         ControlPartCode
  119.  
  120. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  121. ;  • Control ActionProcPtr                                                                                
  122. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  123. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  124. ;     • ControlRecord                                                                                        
  125. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  126. ControlRecord            RECORD 0
  127. nextControl                 ds.l    1                ; offset: $0 (0)
  128. contrlOwner                 ds.l    1                ; offset: $4 (4)
  129. contrlRect                 ds        Rect            ; offset: $8 (8)
  130. contrlVis                 ds.b    1                ; offset: $10 (16)
  131. contrlHilite             ds.b    1                ; offset: $11 (17)
  132. contrlValue                 ds.w    1                ; offset: $12 (18)
  133. contrlMin                 ds.w    1                ; offset: $14 (20)
  134. contrlMax                 ds.w    1                ; offset: $16 (22)
  135. contrlDefProc             ds.l    1                ; offset: $18 (24)
  136. contrlData                 ds.l    1                ; offset: $1C (28)
  137. contrlAction             ds.l    1                ; offset: $20 (32)
  138. contrlRfCon                 ds.l    1                ; offset: $24 (36)
  139. contrlTitle                 ds        Str255            ; offset: $28 (40)
  140. sizeof                     EQU *                    ; size:   $128 (296)
  141.                         ENDR
  142. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  143. ;  • Control ActionProcPtr : Epilogue                                                                    
  144. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  145. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  146. ;     • Control Color Table                                                                                
  147. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  148.  
  149. cFrameColor                        EQU        0
  150. cBodyColor                        EQU        1
  151. cTextColor                        EQU        2
  152. cThumbColor                        EQU        3
  153. kNumberCtlCTabEntries            EQU        4
  154. CtlCTab                    RECORD 0
  155. ccSeed                     ds.l    1                ; offset: $0 (0)
  156. ccRider                     ds.w    1                ; offset: $4 (4)
  157. ctSize                     ds.w    1                ; offset: $6 (6)
  158. ctTable                     ds.b    4 * ColorSpec.sizeof ; offset: $8 (8)
  159. sizeof                     EQU *                    ; size:   $28 (40)
  160.                         ENDR
  161. ; typedef struct CtlCTab *                CCTabPtr
  162.  
  163. ; typedef CCTabPtr *                    CCTabHandle
  164.  
  165. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  166. ;     • Auxiliary Control Record                                                                            
  167. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  168. AuxCtlRec                RECORD 0
  169. acNext                     ds.l    1                ; offset: $0 (0)
  170. acOwner                     ds.l    1                ; offset: $4 (4)
  171. acCTable                 ds.l    1                ; offset: $8 (8)
  172. acFlags                     ds.w    1                ; offset: $C (12)
  173. acReserved                 ds.l    1                ; offset: $E (14)
  174. acRefCon                 ds.l    1                ; offset: $12 (18)
  175. sizeof                     EQU *                    ; size:   $16 (22)
  176.                         ENDR
  177. ; typedef struct AuxCtlRec *            AuxCtlPtr
  178.  
  179. ; typedef AuxCtlPtr *                    AuxCtlHandle
  180.  
  181. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  182. ;     • PopUp Menu Private Data Structure                                                                    
  183. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  184. PopupPrivateData        RECORD 0
  185. mHandle                     ds.l    1                ; offset: $0 (0)
  186. mID                         ds.w    1                ; offset: $4 (4)
  187. sizeof                     EQU *                    ; size:   $6 (6)
  188.                         ENDR
  189. ; typedef struct PopupPrivateData *        PopupPrivateDataPtr
  190.  
  191. ; typedef PopupPrivateDataPtr *            PopupPrivateDataHandle
  192.  
  193.  
  194. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  195. ;     • Errors are in the range -30580 .. -30599                                                            
  196. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  197.  
  198. errMessageNotSupported            EQU        -30580
  199. errDataNotSupported                EQU        -30581
  200. errControlDoesntSupportFocus    EQU        -30582
  201. errWindowDoesntSupportFocus        EQU        -30583
  202. errUnknownControl                EQU        -30584
  203. errCouldntSetFocus                EQU        -30585
  204. errNoRootControl                EQU        -30586
  205. errRootAlreadyExists            EQU        -30587
  206. errInvalidPartCode                EQU        -30588
  207. errControlsAlreadyExist            EQU        -30589
  208. errControlIsNotEmbedder            EQU        -30590
  209. errDataSizeMismatch                EQU        -30591
  210. errControlHiddenOrDisabled        EQU        -30592
  211. errWindowRegionCodeInvalid        EQU        -30593
  212. errCantEmbedIntoSelf            EQU        -30594
  213. errCantEmbedRoot                EQU        -30595
  214. errItemNotControl                EQU        -30596
  215. controlInvalidDataVersionErr    EQU        -30597
  216. controlPropertyInvalid            EQU        -5603
  217. controlPropertyNotFoundErr        EQU        -5604
  218. controlHandleInvalidErr            EQU        -30599
  219. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  220. ;     • Control Definition ID’s                                                                            
  221. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  222. ;  Standard System 7 procIDs
  223.  
  224.  
  225. pushButProc                        EQU        0
  226. checkBoxProc                    EQU        1
  227. radioButProc                    EQU        2
  228. scrollBarProc                    EQU        16
  229. popupMenuProc                    EQU        1008
  230.  
  231. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  232. ;     • Control Types and ID’s available only with Appearance 1.0 and later                                
  233. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  234.  
  235.  
  236. kControlSupportsNewMessages        EQU        ' ok '                ; CDEF should return as result of kControlMsgTestNewMsgSupport
  237. ;  focusing part codes 
  238.  
  239. kControlFocusNoPart                EQU        0                    ; tells control to clear its focus
  240. kControlFocusNextPart            EQU        -1                    ; tells control to focus on the next part
  241. kControlFocusPrevPart            EQU        -2                    ; tells control to focus on the previous part
  242. ; typedef SInt16                         ControlFocusPart
  243.  
  244. ;  Use this constant in Get/SetControlData when the data referred to is not            
  245. ;  specific to a part, but rather the entire control, e.g. the list handle of a     
  246. ;  list box control.                                                                
  247.  
  248. kControlEntireControl            EQU        0
  249. ;  Key Filter result codes                                                             
  250. ;                                                                                     
  251. ;  Certain controls can have a keyfilter attached to them. The filter proc should    
  252. ;  return one of the two constants below. If kKeyFilterBlockKey is returned, the    
  253. ;  key is blocked and never makes it to the control. If kKeyFilterPassKey is        
  254. ;  returned, the control receives the keystroke.                                    
  255.  
  256. kControlKeyFilterBlockKey        EQU        0
  257. kControlKeyFilterPassKey        EQU        1
  258. ; typedef SInt16                         ControlKeyFilterResult
  259.  
  260. ; ——————————————————————————————————————————————————————————————————————————————————————
  261. ;      SPECIAL FONT USAGE NOTES: You can specify the font to use for many control types.
  262. ;    The constants below are meta-font numbers which you can use to set a particular
  263. ;    control's font usage. There are essentially two modes you can use: 1) default,
  264. ;    which is essentially the same as it always has been, i.e. it uses the system font, unless
  265. ;    directed to use the window font via a control variant. 2) you can specify to use
  266. ;    the big or small system font in a generic manner. The Big system font is the font
  267. ;    used in menus, etc. Chicago has filled that role for some time now. Small system
  268. ;    font is currently Geneva 10. The meta-font number implies the size and style.
  269. ;
  270. ;    NOTE:        Not all font attributes are used by all controls. Most, in fact, ignore
  271. ;                the fore and back color (Static Text is the only one that does, for
  272. ;                backwards compatibility). Also size, face, and addFontSize are ignored
  273. ;                when using the meta-font numbering.
  274. ;
  275.  
  276. ; ——————————————————————————————————————————————————————————————————————————————————————
  277.  
  278.                                                             ; Meta-font numbering - see not above 
  279. kControlFontBigSystemFont        EQU        -1                    ; force to big system font
  280. kControlFontSmallSystemFont        EQU        -2                    ; force to small system font
  281. kControlFontSmallBoldSystemFont    EQU        -3                    ; force to small bold system font
  282. ;  Add these masks together to set the flags field of a ControlFontStyleRec    
  283. ;  They specify which fields to apply to the text. It is important to make    
  284. ;  sure that you specify only the fields that you wish to set.                
  285.  
  286. kControlUseFontMask                EQU        $0001
  287. kControlUseFaceMask                EQU        $0002
  288. kControlUseSizeMask                EQU        $0004
  289. kControlUseForeColorMask        EQU        $0008
  290. kControlUseBackColorMask        EQU        $0010
  291. kControlUseModeMask                EQU        $0020
  292. kControlUseJustMask                EQU        $0040
  293. kControlUseAllMask                EQU        $00FF
  294. kControlAddFontSizeMask            EQU        $0100
  295. ;  flags available in Appearance 1.1 or later 
  296. ;  AddToMetaFont indicates that we want to start with a standard system        
  297. ;  font, but then we'd like to add the other attributes. Normally, the meta    
  298. ;  font ignores all other flags                                             
  299.  
  300. kControlAddToMetaFontMask        EQU        $0200
  301. ControlFontStyleRec        RECORD 0
  302. flags                     ds.w    1                ; offset: $0 (0)
  303. font                     ds.w    1                ; offset: $2 (2)
  304. size                     ds.w    1                ; offset: $4 (4)
  305. style                     ds.w    1                ; offset: $6 (6)
  306. mode                     ds.w    1                ; offset: $8 (8)
  307. just                     ds.w    1                ; offset: $A (10)
  308. foreColor                 ds        RGBColor        ; offset: $C (12)
  309. backColor                 ds        RGBColor        ; offset: $12 (18)
  310. sizeof                     EQU *                    ; size:   $18 (24)
  311.                         ENDR
  312. ; typedef struct ControlFontStyleRec *    ControlFontStylePtr
  313.  
  314. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  315. ;     • Common data tags for Get/SetControlData                                                            
  316. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  317.  
  318. kControlFontStyleTag            EQU        'font'
  319. kControlKeyFilterTag            EQU        'fltr'
  320.  
  321. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  322. ;     • Control Feature Bits                                                                                
  323. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  324.  
  325.                                                             ; Control feature bits - returned by GetControlFeatures 
  326. kControlSupportsGhosting        EQU        $01
  327. kControlSupportsEmbedding        EQU        $02
  328. kControlSupportsFocus            EQU        $04
  329. kControlWantsIdle                EQU        $08
  330. kControlWantsActivate            EQU        $10
  331. kControlHandlesTracking            EQU        $20
  332. kControlSupportsDataAccess        EQU        $40
  333. kControlHasSpecialBackground    EQU        $80
  334. kControlGetsFocusOnClick        EQU        $0100
  335. kControlSupportsCalcBestRect    EQU        $0200
  336. kControlSupportsLiveFeedback    EQU        $0400
  337. ;  Features introduced in Appearance 1.0.1 
  338.  
  339. kControlHasRadioBehavior        EQU        $0800
  340. ;  Features introduced in Appearance 1.1 
  341.  
  342. kControlAutoToggles                EQU        $4000
  343. kControlSupportsGetRegion        EQU        $00020000
  344. ;  Control Messages 
  345.  
  346. kControlMsgDrawGhost            EQU        13
  347. kControlMsgCalcBestRect            EQU        14                    ; Calculate best fitting rectangle for control
  348. kControlMsgHandleTracking        EQU        15
  349. kControlMsgFocus                EQU        16                    ; param indicates action.
  350. kControlMsgKeyDown                EQU        17
  351. kControlMsgIdle                    EQU        18
  352. kControlMsgGetFeatures            EQU        19
  353. kControlMsgSetData                EQU        20
  354. kControlMsgGetData                EQU        21
  355. kControlMsgActivate                EQU        22
  356. kControlMsgSetUpBackground        EQU        23
  357. kControlMsgCalcValueFromPos        EQU        26
  358. kControlMsgTestNewMsgSupport    EQU        27                    ; See if this control supports new messaging
  359. ;  Messages in Appearance 1.0.1 or later
  360.  
  361. kControlMsgSubValueChanged        EQU        25
  362. kControlMsgSubControlAdded        EQU        28
  363. kControlMsgSubControlRemoved    EQU        29
  364. ;  Messages in Appearance 1.1 or later 
  365.  
  366. kControlMsgApplyTextColor        EQU        30
  367. kControlMsgGetRegion            EQU        31
  368. ; ——————————————————————————————————————————————————————————————————————————————————————
  369. ;      This structure is passed into a CDEF when called with the kControlMsgHandleTracking    
  370. ;     message                                                                             
  371. ; ——————————————————————————————————————————————————————————————————————————————————————
  372. ControlTrackingRec        RECORD 0
  373. startPt                     ds        Point            ; offset: $0 (0)
  374. modifiers                 ds.w    1                ; offset: $4 (4)
  375. action                     ds.l    1                ; offset: $6 (6)
  376. sizeof                     EQU *                    ; size:   $A (10)
  377.                         ENDR
  378. ; typedef struct ControlTrackingRec *    ControlTrackingPtr
  379.  
  380. ; ——————————————————————————————————————————————————————————————————————————————————————
  381. ;  This structure is passed into a CDEF when called with the kControlMsgKeyDown message 
  382. ; ——————————————————————————————————————————————————————————————————————————————————————
  383. ControlKeyDownRec        RECORD 0
  384. modifiers                 ds.w    1                ; offset: $0 (0)
  385. keyCode                     ds.w    1                ; offset: $2 (2)
  386. charCode                 ds.w    1                ; offset: $4 (4)
  387. sizeof                     EQU *                    ; size:   $6 (6)
  388.                         ENDR
  389. ; typedef struct ControlKeyDownRec *    ControlKeyDownPtr
  390.  
  391. ; ——————————————————————————————————————————————————————————————————————————————————————
  392. ;  This structure is passed into a CDEF when called with the kControlMsgGetData or        
  393. ;  kControlMsgSetData message                                                             
  394. ; ——————————————————————————————————————————————————————————————————————————————————————
  395. ControlDataAccessRec    RECORD 0
  396. tag                         ds.l    1                ; offset: $0 (0)
  397. part                     ds.l    1                ; offset: $4 (4)
  398. size                     ds.l    1                ; offset: $8 (8)
  399. dataPtr                     ds.l    1                ; offset: $C (12)
  400. sizeof                     EQU *                    ; size:   $10 (16)
  401.                         ENDR
  402. ; typedef struct ControlDataAccessRec *    ControlDataAccessPtr
  403.  
  404. ; ——————————————————————————————————————————————————————————————————————————————————————
  405. ;  This structure is passed into a CDEF when called with the kControlCalcBestRect msg     
  406. ; ——————————————————————————————————————————————————————————————————————————————————————
  407. ControlCalcSizeRec        RECORD 0
  408. height                     ds.w    1                ; offset: $0 (0)
  409. width                     ds.w    1                ; offset: $2 (2)
  410. baseLine                 ds.w    1                ; offset: $4 (4)
  411. sizeof                     EQU *                    ; size:   $6 (6)
  412.                         ENDR
  413. ; typedef struct ControlCalcSizeRec *    ControlCalcSizePtr
  414.  
  415. ; ——————————————————————————————————————————————————————————————————————————————————————
  416. ;  This structure is passed into a CDEF when called with the kControlMsgSetUpBackground 
  417. ;  message is sent                                                                        
  418. ; ——————————————————————————————————————————————————————————————————————————————————————
  419. ControlBackgroundRec    RECORD 0
  420. depth                     ds.w    1                ; offset: $0 (0)
  421. colorDevice                 ds.b    1                ; offset: $2 (2)
  422.                          ORG 4
  423. sizeof                     EQU *                    ; size:   $4 (4)
  424.                         ENDR
  425. ; typedef struct ControlBackgroundRec *    ControlBackgroundPtr
  426.  
  427. ; ——————————————————————————————————————————————————————————————————————————————————————
  428. ;  This structure is passed into a CDEF when called with the kControlMsgApplyTextColor    
  429. ;  message is sent                                                                        
  430. ; ——————————————————————————————————————————————————————————————————————————————————————
  431. ControlApplyTextColorRec RECORD 0
  432. depth                     ds.w    1                ; offset: $0 (0)
  433. colorDevice                 ds.b    1                ; offset: $2 (2)
  434. active                     ds.b    1                ; offset: $3 (3)
  435. sizeof                     EQU *                    ; size:   $4 (4)
  436.                         ENDR
  437. ; typedef struct ControlApplyTextColorRec * ControlApplyTextColorPtr
  438.  
  439. ; ——————————————————————————————————————————————————————————————————————————————————————
  440. ;  This structure is passed into a CDEF when called with the kControlMsgGetRegion        
  441. ;  message is sent                                                                        
  442. ; ——————————————————————————————————————————————————————————————————————————————————————
  443. ControlGetRegionRec        RECORD 0
  444. region                     ds.l    1                ; offset: $0 (0)
  445. part                     ds.w    1                ; offset: $4 (4)
  446. sizeof                     EQU *                    ; size:   $6 (6)
  447.                         ENDR
  448. ; typedef struct ControlGetRegionRec *    ControlGetRegionPtr
  449.  
  450. ; ——————————————————————————————————————————————————————————————————————————————————————
  451. ;     Key Filter                                                                            
  452. ;                                                                                         
  453. ;  Definition of a key filter for intercepting and possibly changing keystrokes            
  454. ;  which are destined for a control                                                        
  455. ; ——————————————————————————————————————————————————————————————————————————————————————
  456. ; ——————————————————————————————————————————————————————————————————————————————————————
  457. ;     • BEVEL BUTTON INTERFACE (CDEF 2)                                                    
  458. ; ——————————————————————————————————————————————————————————————————————————————————————
  459. ;     Bevel buttons allow you to control the content type (pict/icon/etc.), the behavior    
  460. ;  (pushbutton/toggle/sticky), and the bevel size. You also have the option of            
  461. ;     attaching a menu to it. When a menu is present, you can specify which way the         
  462. ;     popup arrow is facing (down or right).                                                
  463. ;                                                                                         
  464. ;     This is all made possible by overloading the Min, Max, and Value parameters for the    
  465. ;     control, as well as adjusting the variant. Here's the breakdown of what goes where:    
  466. ;                                                                                         
  467. ;     Parameter                    What Goes Here                                            
  468. ;     ———————————————————            ————————————————————————————————————————————————————    
  469. ;     Min                            Hi Byte = Behavior, Lo Byte = content type.                
  470. ;     Max                            ResID for resource-based content types.                    
  471. ;     Value                        MenuID to attach, 0 = no menu, please.                    
  472. ;                                                                                         
  473. ;     The variant is broken down into two halfs. The low 2 bits control the bevel type.    
  474. ;     Bit 2 controls the popup arrow direction (if a menu is present) and bit 3 controls    
  475. ;     whether or not to use the control's owning window's font.                            
  476. ;                                                                                         
  477. ;     Constants for all you need to put this together are below. The values for behaviors    
  478. ;     are set up so that you can simply add them to the content type and pass them into    
  479. ;     the Min parameter of NewControl.                                                    
  480. ;                                                                                         
  481. ;     An example call:                                                                    
  482. ;                                                                                         
  483. ;     control = NewControl( window, &bounds, "\p", true, 0, kContentIconSuiteRes +         
  484. ;                             kBehaviorToggles, myIconSuiteID, bevelButtonSmallBevelProc,    
  485. ;                             0L );                                                        
  486. ;                                                                                         
  487. ;     Attaching a menu:                                                                    
  488. ;                                                                                         
  489. ;     control = NewControl( window, &bounds, "\p", true, kMyMenuID, kContentIconSuiteRes,    
  490. ;             myIconSuiteID, bevelButtonSmallBevelProc + kBevelButtonMenuOnRight, 0L );    
  491. ;                                                                                         
  492. ;     This will attach menu ID kMyMenuID to the button, with the popup arrow facing right.
  493. ;     This also puts the menu up to the right of the button. You can also specify that a    
  494. ;     menu can have multiple items checked at once by adding kBehaviorMultiValueMenus        
  495. ;     into the Min parameter. If you do use multivalue menus, the GetBevelButtonMenuValue    
  496. ;     helper function will return the last item chosen from the menu, whether or not it    
  497. ;     was checked.                                                                        
  498. ;                                                                                         
  499. ;     NOTE:     Bevel buttons with menus actually have *two* values. The value of the         
  500. ;             button (on/off), and the value of the menu. The menu value can be gotten    
  501. ;             with the GetBevelButtonMenuValue helper function.                            
  502. ;                                                                                         
  503. ;     Handle-based Content                                                                
  504. ;     ————————————————————                                                                
  505. ;     You can create your control and then set the content to an existing handle to an    
  506. ;     icon suite, etc. using the macros below. Please keep in mind that resource-based    
  507. ;     content is owned by the control, handle-based content is owned by you. The CDEF will
  508. ;     not try to dispose of handle-based content. If you are changing the content type of    
  509. ;     the button on the fly, you must make sure that if you are replacing a handle-        
  510. ;     based content with a resource-based content to properly dispose of the handle,        
  511. ;     else a memory leak will ensue.                                                        
  512. ;                                                                                         
  513.  
  514.                                                             ; Bevel Button Proc IDs 
  515. kControlBevelButtonSmallBevelProc EQU    32
  516. kControlBevelButtonNormalBevelProc EQU    33
  517. kControlBevelButtonLargeBevelProc EQU    34
  518.  
  519.                                                             ; Bevel button graphic alignment values 
  520. kControlBevelButtonAlignSysDirection EQU -1                    ; only left or right
  521. kControlBevelButtonAlignCenter    EQU        0
  522. kControlBevelButtonAlignLeft    EQU        1
  523. kControlBevelButtonAlignRight    EQU        2
  524. kControlBevelButtonAlignTop        EQU        3
  525. kControlBevelButtonAlignBottom    EQU        4
  526. kControlBevelButtonAlignTopLeft    EQU        5
  527. kControlBevelButtonAlignBottomLeft EQU    6
  528. kControlBevelButtonAlignTopRight EQU    7
  529. kControlBevelButtonAlignBottomRight EQU    8
  530. ; typedef SInt16                         ControlButtonGraphicAlignment
  531.  
  532.  
  533.                                                             ; Bevel button text alignment values 
  534. kControlBevelButtonAlignTextSysDirection EQU 0
  535. kControlBevelButtonAlignTextCenter EQU    1
  536. kControlBevelButtonAlignTextFlushRight EQU -1
  537. kControlBevelButtonAlignTextFlushLeft EQU -2
  538. ; typedef SInt16                         ControlButtonTextAlignment
  539.  
  540.  
  541.                                                             ; Bevel button text placement values 
  542. kControlBevelButtonPlaceSysDirection EQU -1                    ; if graphic on right, then on left
  543. kControlBevelButtonPlaceNormally EQU    0
  544. kControlBevelButtonPlaceToRightOfGraphic EQU 1
  545. kControlBevelButtonPlaceToLeftOfGraphic EQU 2
  546. kControlBevelButtonPlaceBelowGraphic EQU 3
  547. kControlBevelButtonPlaceAboveGraphic EQU 4
  548. ; typedef SInt16                         ControlButtonTextPlacement
  549.  
  550. ;  Add these variant codes to kBevelButtonSmallBevelProc to change the type of button 
  551.  
  552. kControlBevelButtonSmallBevelVariant EQU 0
  553. kControlBevelButtonNormalBevelVariant EQU $01
  554. kControlBevelButtonLargeBevelVariant EQU $02
  555. kControlBevelButtonMenuOnRight    EQU        $04
  556.  
  557. ;   Behaviors of bevel buttons. These are set up so you can add
  558. ;   them together with the content types.
  559.  
  560.  
  561.  
  562. kControlBehaviorPushbutton        EQU        0
  563. kControlBehaviorToggles            EQU        $0100
  564. kControlBehaviorSticky            EQU        $0200
  565. kControlBehaviorMultiValueMenu    EQU        $4000                ; only makes sense when a menu is attached.
  566. kControlBehaviorOffsetContents    EQU        $8000
  567. ;  Behaviors for 1.0.1 or later 
  568.  
  569. kControlBehaviorCommandMenu        EQU        $2000                ; menu holds commands, not choices. Overrides multi-value bit.
  570. ;  Content types supported by bevel buttons *and* image wells
  571.  
  572. kControlContentTextOnly            EQU        0
  573. kControlContentIconSuiteRes        EQU        1
  574. kControlContentCIconRes            EQU        2
  575. kControlContentPictRes            EQU        3
  576. kControlContentIconSuiteHandle    EQU        129
  577. kControlContentCIconHandle        EQU        130
  578. kControlContentPictHandle        EQU        131
  579. kControlContentIconRef            EQU        132
  580. ; typedef SInt16                         ControlContentType
  581.  
  582. ;  Data tags supported by the bevel button controls 
  583.  
  584. kControlBevelButtonContentTag    EQU        'cont'                ; ButtonContentInfo
  585. kControlBevelButtonTransformTag    EQU        'tran'                ; IconTransformType
  586. kControlBevelButtonTextAlignTag    EQU        'tali'                ; ButtonTextAlignment
  587. kControlBevelButtonTextOffsetTag EQU    'toff'                ; SInt16
  588. kControlBevelButtonGraphicAlignTag EQU    'gali'                ; ButtonGraphicAlignment
  589. kControlBevelButtonGraphicOffsetTag EQU    'goff'                ; Point
  590. kControlBevelButtonTextPlaceTag    EQU        'tplc'                ; ButtonTextPlacement
  591. kControlBevelButtonMenuValueTag    EQU        'mval'                ; SInt16
  592. kControlBevelButtonMenuHandleTag EQU    'mhnd'                ; MenuHandle
  593. kControlBevelButtonCenterPopupGlyphTag EQU 'pglc'            ; Boolean: true = center, false = bottom right
  594. ;  These are tags in 1.0.1 or later 
  595.  
  596. kControlBevelButtonLastMenuTag    EQU        'lmnu'                ; SInt16: menuID of last menu item selected from
  597. kControlBevelButtonMenuDelayTag    EQU        'mdly'                ; SInt32: ticks to delay before menu appears
  598. ;  tags available with Appearance 1.1 or later 
  599.  
  600.                                                             ; Boolean: True = if an icon of the ideal size for
  601.                                                             ; the button isn't available, scale a larger or
  602.                                                             ; smaller icon to the ideal size. False = don't
  603.                                                             ; scale; draw a smaller icon or clip a larger icon.
  604.                                                             ; Default is false. Only applies to IconSuites and
  605. kControlBevelButtonScaleIconTag    EQU        'scal'                ; IconRefs.
  606. ;  Structure to pass into bevel buttons and image wells to set/get content type 
  607. ControlButtonContentInfo RECORD 0
  608. contentType                 ds.w    1                ; offset: $0 (0)
  609. resID                     ds.w    1                ; offset: $2 (2)
  610.                          ORG 2
  611. cIconHandle                 ds.l    1                ; offset: $2 (2)
  612.                          ORG 2
  613. iconSuite                 ds.l    1                ; offset: $2 (2)
  614.                          ORG 2
  615. iconRef                     ds.l    1                ; offset: $2 (2)
  616.                          ORG 2
  617. picture                     ds.l    1                ; offset: $2 (2)
  618. sizeof                     EQU *                    ; size:   $6 (6)
  619.                         ENDR
  620. ; typedef struct ControlButtonContentInfo * ControlButtonContentInfoPtr
  621.  
  622. ; ——————————————————————————————————————————————————————————————————————————————————————
  623. ;     • SLIDER (CDEF 3)                                                                    
  624. ; ——————————————————————————————————————————————————————————————————————————————————————
  625. ;     There are several variants that control the behavior of the slider control. Any        
  626. ;     combination of the following three constants can be added to the basic CDEF ID        
  627. ;     (kSliderProc).                                                                        
  628. ;                                                                                         
  629. ;     Variants:                                                                            
  630. ;                                                                                         
  631. ;         kSliderLiveFeedback         Slider does not use "ghosted" indicator when tracking.    
  632. ;                                 ActionProc is called (set via SetControlAction) as the    
  633. ;                                 indicator is dragged. The value is updated so that the    
  634. ;                                 actionproc can adjust some other property based on the    
  635. ;                                 value each time the action proc is called. If no action    
  636. ;                                 proc is installed, it reverts to the ghost indicator.    
  637. ;                                                                                         
  638. ;         kSliderHasTickMarks         Slider is drawn with 'tick marks'. The control            
  639. ;                                 rectangle must be large enough to accomidate the tick    
  640. ;                                 marks.                                                    
  641. ;                                                                                         
  642. ;         kSliderReverseDirection    Slider thumb points in opposite direction than normal.    
  643. ;                                 If the slider is vertical, the thumb will point to the    
  644. ;                                 left, if the slider is horizontal, the thumb will point    
  645. ;                                 upwards.                                                
  646. ;                                                                                         
  647. ;         kSliderNonDirectional    This option overrides the kSliderReverseDirection and    
  648. ;                                 kSliderHasTickMarks variants. It creates an indicator    
  649. ;                                 which is rectangular and doesn't point in any direction    
  650. ;                                 like the normal indicator does.                            
  651.  
  652.                                                             ; Slider proc IDs 
  653. kControlSliderProc                EQU        48
  654. kControlSliderLiveFeedback        EQU        $01
  655. kControlSliderHasTickMarks        EQU        $02
  656. kControlSliderReverseDirection    EQU        $04
  657. kControlSliderNonDirectional    EQU        $08
  658.  
  659. ; ——————————————————————————————————————————————————————————————————————————————————————
  660. ;     • DISCLOSURE TRIANGLE (CDEF 4)                                                        
  661. ; ——————————————————————————————————————————————————————————————————————————————————————
  662. ;     This control can be used as either left or right facing. It can also handle its own    
  663. ;     tracking if you wish. This means that when the 'autotoggle' variant is used, if the    
  664. ;     user clicks the control, it's state will change automatically from open to closed    
  665. ;     and vice-versa depending on its initial state. After a successful call to Track-    
  666. ;      Control, you can just check the current value to see what state it was switched to.    
  667.  
  668.                                                             ; Triangle proc IDs 
  669. kControlTriangleProc            EQU        64
  670. kControlTriangleLeftFacingProc    EQU        65
  671. kControlTriangleAutoToggleProc    EQU        66
  672. kControlTriangleLeftFacingAutoToggleProc EQU 67
  673.  
  674.                                                             ; Tagged data supported by disclosure triangles 
  675. kControlTriangleLastValueTag    EQU        'last'                ; SInt16
  676. ; ——————————————————————————————————————————————————————————————————————————————————————
  677. ;     • PROGRESS INDICATOR (CDEF 5)                                                        
  678. ; ——————————————————————————————————————————————————————————————————————————————————————
  679. ;     This CDEF implements both determinate and indeterminate progress bars. To switch,     
  680. ;     just use SetControlData to set the indeterminate flag to make it indeterminate call    
  681. ;     IdleControls to step thru the animation. IdleControls should be called at least        
  682. ;     once during your event loop.                                                        
  683. ;                                                                                         
  684.  
  685.                                                             ; Progress Bar proc IDs 
  686. kControlProgressBarProc            EQU        80
  687.  
  688.                                                             ; Tagged data supported by progress bars 
  689. kControlProgressBarIndeterminateTag EQU    'inde'                ; Boolean
  690. ; ——————————————————————————————————————————————————————————————————————————————————————
  691. ;     • LITTLE ARROWS (CDEF 6)                                                            
  692. ; ——————————————————————————————————————————————————————————————————————————————————————
  693. ;      This control implements the little up and down arrows you'd see in the Memory        
  694. ;     control panel for adjusting the cache size.                                         
  695.  
  696.                                                             ; Little Arrows proc IDs 
  697. kControlLittleArrowsProc        EQU        96
  698. ; ——————————————————————————————————————————————————————————————————————————————————————
  699. ;     • CHASING ARROWS (CDEF 7)                                                            
  700. ; ——————————————————————————————————————————————————————————————————————————————————————
  701. ;     To animate this control, make sure to call IdleControls repeatedly.                    
  702. ;                                                                                         
  703.  
  704.                                                             ; Chasing Arrows proc IDs 
  705. kControlChasingArrowsProc        EQU        112
  706. ; ——————————————————————————————————————————————————————————————————————————————————————
  707. ;     • TABS (CDEF 8)                                                                        
  708. ; ——————————————————————————————————————————————————————————————————————————————————————
  709. ;     Tabs use an auxiliary resource (tab#) to hold tab information such as the tab name    
  710. ;     and an icon suite ID for each tab.                                                    
  711. ;                                                                                         
  712. ;     The ID of the tab# resource that you wish to associate with a tab control should     
  713. ;     be passed in as the Value parameter of the control. If you are using GetNewControl, 
  714. ;     then the Value slot in the CNTL resource should have the ID of the 'tab#' resource    
  715. ;     on creation.                                                                        
  716. ;                                                                                         
  717. ;     Passing zero in for the tab# resource tells the control not to read in a tab# res.    
  718. ;     You can then use SetControlMaximum to add tabs, followed by a call to SetControlData
  719. ;     with the kControlTabInfoTag, passing in a pointer to a ControlTabInfoRec. This sets    
  720. ;      the name and optionally an icon for a tab.                                            
  721.  
  722.                                                             ; Tabs proc IDs 
  723. kControlTabLargeProc            EQU        128                    ; Large tab size, north facing    
  724. kControlTabSmallProc            EQU        129                    ; Small tab size, north facing    
  725. kControlTabLargeNorthProc        EQU        128                    ; Large tab size, north facing    
  726. kControlTabSmallNorthProc        EQU        129                    ; Small tab size, north facing    
  727. kControlTabLargeSouthProc        EQU        130                    ; Large tab size, south facing    
  728. kControlTabSmallSouthProc        EQU        131                    ; Small tab size, south facing    
  729. kControlTabLargeEastProc        EQU        132                    ; Large tab size, east facing    
  730. kControlTabSmallEastProc        EQU        133                    ; Small tab size, east facing    
  731. kControlTabLargeWestProc        EQU        134                    ; Large tab size, west facing    
  732. kControlTabSmallWestProc        EQU        135                    ; Small tab size, west facing    
  733.  
  734.                                                             ; Tagged data supported by progress bars 
  735. kControlTabContentRectTag        EQU        'rect'                ; Rect
  736. kControlTabEnabledFlagTag        EQU        'enab'                ; Boolean
  737. kControlTabFontStyleTag            EQU        'font'                ; ControlFontStyleRec
  738. ;  New tags in 1.0.1 or later 
  739.  
  740. kControlTabInfoTag                EQU        'tabi'                ; ControlTabInfoRec
  741.  
  742. kControlTabInfoVersionZero        EQU        0
  743. ControlTabInfoRec        RECORD 0
  744. version                     ds.w    1                ; offset: $0 (0)        ;  version of this structure.
  745. iconSuiteID                 ds.w    1                ; offset: $2 (2)        ;  icon suite to use. Zero indicates no icon
  746. name                     ds        Str255            ; offset: $4 (4)        ;  name to be displayed on the tab
  747. sizeof                     EQU *                    ; size:   $104 (260)
  748.                         ENDR
  749. ; ——————————————————————————————————————————————————————————————————————————————————————
  750. ;     • VISUAL SEPARATOR (CDEF 9)                                                            
  751. ; ——————————————————————————————————————————————————————————————————————————————————————
  752. ;     Separator lines determine their orientation (horizontal or vertical) automatically    
  753. ;     based on the relative height and width of their contrlRect.                            
  754.  
  755.                                                             ; Visual separator proc IDs 
  756. kControlSeparatorLineProc        EQU        144
  757.  
  758. ; ——————————————————————————————————————————————————————————————————————————————————————
  759. ;     • GROUP BOX (CDEF 10)                                                                
  760. ; ——————————————————————————————————————————————————————————————————————————————————————
  761. ;     The group box CDEF can be use in several ways. It can have no title, a text title,     
  762. ;     a check box as the title, or a popup button as a title. There are two versions of     
  763. ;     group boxes, primary and secondary, which look slightly different.                    
  764.  
  765.                                                             ; Group Box proc IDs 
  766. kControlGroupBoxTextTitleProc    EQU        160
  767. kControlGroupBoxCheckBoxProc    EQU        161
  768. kControlGroupBoxPopupButtonProc    EQU        162
  769. kControlGroupBoxSecondaryTextTitleProc EQU 164
  770. kControlGroupBoxSecondaryCheckBoxProc EQU 165
  771. kControlGroupBoxSecondaryPopupButtonProc EQU 166
  772.  
  773.                                                             ; Tagged data supported by group box 
  774. kControlGroupBoxMenuHandleTag    EQU        'mhan'                ; MenuHandle (popup title only)
  775. kControlGroupBoxFontStyleTag    EQU        'font'                ; ControlFontStyleRec
  776. ;  tags available with Appearance 1.1 or later 
  777.  
  778. kControlGroupBoxTitleRectTag    EQU        'trec'                ; Rect. Rectangle that the title text/control is drawn in. (get only)
  779. ; ——————————————————————————————————————————————————————————————————————————————————————
  780. ;     • IMAGE WELL (CDEF 11)                                                                
  781. ; ——————————————————————————————————————————————————————————————————————————————————————
  782. ;     Image Wells allow you to control the content type (pict/icon/etc.) shown in the     
  783. ;     well.                                                                                
  784. ;                                                                                         
  785. ;     This is made possible by overloading the Min and Value parameters for the control.    
  786. ;                                                                                         
  787. ;     Parameter                    What Goes Here                                            
  788. ;     ———————————————————            ——————————————————————————————————————————————————        
  789. ;     Min                            content type (see constants for bevel buttons)            
  790. ;     Value                        Resource ID of content type, if resource-based.            
  791. ;                                                                                         
  792. ;                                                                                         
  793. ;     Handle-based Content                                                                
  794. ;     ————————————————————                                                                
  795. ;     You can create your control and then set the content to an existing handle to an    
  796. ;     icon suite, etc. using the macros below. Please keep in mind that resource-based    
  797. ;     content is owned by the control, handle-based content is owned by you. The CDEF will
  798. ;     not try to dispose of handle-based content. If you are changing the content type of    
  799. ;     the button on the fly, you must make sure that if you are replacing a handle-        
  800. ;     based content with a resource-based content to properly dispose of the handle,        
  801. ;     else a memory leak will ensue.                                                        
  802. ;                                                                                         
  803.  
  804.                                                             ; Image Well proc IDs 
  805. kControlImageWellProc            EQU        176
  806.  
  807.                                                             ; Tagged data supported by image wells 
  808. kControlImageWellContentTag        EQU        'cont'                ; ButtonContentInfo
  809. kControlImageWellTransformTag    EQU        'tran'                ; IconTransformType
  810. ; ——————————————————————————————————————————————————————————————————————————————————————
  811. ;     • POPUP ARROW (CDEF 12)                                                                
  812. ; ——————————————————————————————————————————————————————————————————————————————————————
  813. ;     The popup arrow CDEF is used to draw the small arrow normally associated with a     
  814. ;     popup control. The arrow can point in four directions, and a small or large version 
  815. ;     can be used. This control is provided to allow clients to draw the arrow in a         
  816. ;     normalized fashion which will take advantage of themes automatically.                
  817. ;                                                                                         
  818.  
  819.                                                             ; Popup Arrow proc IDs 
  820. kControlPopupArrowEastProc        EQU        192
  821. kControlPopupArrowWestProc        EQU        193
  822. kControlPopupArrowNorthProc        EQU        194
  823. kControlPopupArrowSouthProc        EQU        195
  824. kControlPopupArrowSmallEastProc    EQU        196
  825. kControlPopupArrowSmallWestProc    EQU        197
  826. kControlPopupArrowSmallNorthProc EQU    198
  827. kControlPopupArrowSmallSouthProc EQU    199
  828. ; ——————————————————————————————————————————————————————————————————————————————————————
  829. ;     • PLACARD (CDEF 14)                                                                    
  830. ; ——————————————————————————————————————————————————————————————————————————————————————
  831.  
  832.                                                             ; Placard proc IDs 
  833. kControlPlacardProc                EQU        224
  834. ; ——————————————————————————————————————————————————————————————————————————————————————
  835. ;     • CLOCK (CDEF 15)                                                                    
  836. ; ——————————————————————————————————————————————————————————————————————————————————————
  837. ;      NOTE:    You can specify more options in the Value paramter when creating the clock.    
  838. ;             See below.                                                                    
  839. ;                                                                                         
  840. ;     NOTE:    Under Appearance 1.1, the clock control knows and returns more part codes.    
  841. ;             The new clock-specific part codes are defined with the other control parts.    
  842. ;             Besides these clock-specific parts, we also return kControlUpButtonPart        
  843. ;             and kControlDownButtonPart when they hit the up and down arrows.            
  844. ;             The new part codes give you more flexibility for focusing and hit testing.    
  845. ;                                                                                         
  846. ;             The original kControlClockPart is still valid. When hit testing, it means    
  847. ;             that some non-editable area of the clock's whitespace has been clicked.        
  848. ;             When focusing a currently unfocused clock, it changes the focus to the        
  849. ;             first part; it is the same as passing kControlFocusNextPart. When            
  850. ;             re-focusing a focused clock, it will not change the focus at all.            
  851.  
  852.                                                             ; Clock proc IDs 
  853. kControlClockTimeProc            EQU        240
  854. kControlClockTimeSecondsProc    EQU        241
  855. kControlClockDateProc            EQU        242
  856. kControlClockMonthYearProc        EQU        243
  857. ; ——————————————————————————————————————————————————————————————————————————————————————
  858. ;      These flags can be passed into 'value' field on creation of the control.            
  859. ;      Value is set to 0 after control is created.                                            
  860. ;                                                                                         
  861. ;     The kClockIsLive value tells the clock to automatically update on idle (clock will    
  862. ;     have the current time). This flag is only valid when the kClockIsDisplayOnly flag    
  863. ;     is set.                                                                                
  864. ; ——————————————————————————————————————————————————————————————————————————————————————
  865.  
  866. kControlClockNoFlags            EQU        0
  867. kControlClockIsDisplayOnly        EQU        1
  868. kControlClockIsLive                EQU        2
  869.  
  870.                                                             ; Tagged data supported by clocks 
  871. kControlClockLongDateTag        EQU        'date'                ; LongDateRec
  872. kControlClockFontStyleTag        EQU        'font'                ; ControlFontStyleRec
  873. ; ——————————————————————————————————————————————————————————————————————————————————————
  874. ;     • USER PANE (CDEF 16)                                                                
  875. ; ——————————————————————————————————————————————————————————————————————————————————————
  876.  
  877.                                                             ; User Pane proc IDs 
  878. kControlUserPaneProc            EQU        256
  879. ;  Tagged data supported by user panes 
  880. ;  Currently, they are all proc ptrs for doing things like drawing and hit testing, etc. 
  881.  
  882. kControlUserItemDrawProcTag        EQU        'uidp'                ; UserItemUPP
  883. kControlUserPaneDrawProcTag        EQU        'draw'                ; ControlUserPaneDrawingUPP
  884. kControlUserPaneHitTestProcTag    EQU        'hitt'                ; ControlUserPaneHitTestUPP
  885. kControlUserPaneTrackingProcTag    EQU        'trak'                ; ControlUserPaneTrackingUPP
  886. kControlUserPaneIdleProcTag        EQU        'idle'                ; ControlUserPaneIdleUPP
  887. kControlUserPaneKeyDownProcTag    EQU        'keyd'                ; ControlUserPaneKeyDownUPP
  888. kControlUserPaneActivateProcTag    EQU        'acti'                ; ControlUserPaneActivateUPP
  889. kControlUserPaneFocusProcTag    EQU        'foci'                ; ControlUserPaneFocusUPP
  890. kControlUserPaneBackgroundProcTag EQU    'back'                ; ControlUserPaneBackgroundUPP
  891.  
  892. ;  ——————————————————————————————————————————————————————————————————————————————————————————
  893. ;      • EDIT TEXT (CDEF 17)
  894. ;  ——————————————————————————————————————————————————————————————————————————————————————————
  895.  
  896.  
  897.  
  898.                                                             ; Edit Text proc IDs 
  899. kControlEditTextProc            EQU        272
  900. kControlEditTextPasswordProc    EQU        274
  901. ;  proc IDs available with Appearance 1.1 or later 
  902.  
  903. kControlEditTextInlineInputProc    EQU        276                    ; Can't combine with the other variants
  904.  
  905.                                                             ; Tagged data supported by edit text 
  906. kControlEditTextStyleTag        EQU        'font'                ; ControlFontStyleRec
  907. kControlEditTextTextTag            EQU        'text'                ; Buffer of chars - you supply the buffer
  908. kControlEditTextTEHandleTag        EQU        'than'                ; The TEHandle of the text edit record
  909. kControlEditTextKeyFilterTag    EQU        'fltr'
  910. kControlEditTextSelectionTag    EQU        'sele'                ; EditTextSelectionRec
  911. kControlEditTextPasswordTag        EQU        'pass'                ; The clear text password text
  912. ;  tags available with Appearance 1.1 or later 
  913.  
  914. kControlEditTextLockedTag        EQU        'lock'                ; Boolean. Locking disables editability.
  915. kControlEditTextFixedTextTag    EQU        'ftxt'                ; Like the normal text tag, but fixes inline input first
  916. kControlEditTextValidationProcTag EQU    'vali'                ; ControlEditTextValidationUPP. Called when a key filter can't be: after cut, paste, inline text entry, etc.
  917. kControlEditTextInlinePreUpdateProcTag EQU 'prup'            ; TSMTEPreUpdateUPP and TSMTEPostUpdateUpp. For use with inline input variant...
  918. kControlEditTextInlinePostUpdateProcTag EQU 'poup'            ; ...The refCon parameter will contain the ControlHandle.
  919. ControlEditTextSelectionRec RECORD 0
  920. ;  Structure for getting the edit text selection 
  921. selStart                 ds.w    1                ; offset: $0 (0)
  922. selEnd                     ds.w    1                ; offset: $2 (2)
  923. sizeof                     EQU *                    ; size:   $4 (4)
  924.                         ENDR
  925. ; typedef struct ControlEditTextSelectionRec * ControlEditTextSelectionPtr
  926.  
  927. ; ——————————————————————————————————————————————————————————————————————————————————————
  928. ;     • STATIC TEXT (CDEF 18)                                                                
  929. ; ——————————————————————————————————————————————————————————————————————————————————————
  930. ;  Static Text proc IDs 
  931.  
  932. kControlStaticTextProc            EQU        288
  933. ;  Tagged data supported by static text 
  934.  
  935. kControlStaticTextStyleTag        EQU        'font'                ; ControlFontStyleRec
  936. kControlStaticTextTextTag        EQU        'text'                ; Copy of text
  937. kControlStaticTextTextHeightTag    EQU        'thei'                ; SInt16
  938. ;  Tags available with appearance 1.1 or later 
  939.  
  940. kControlStaticTextTruncTag        EQU        'trun'                ; TruncCode (-1 means no truncation)
  941. ; ——————————————————————————————————————————————————————————————————————————————————————
  942. ;     • PICTURE CONTROL (CDEF 19)                                                            
  943. ; ——————————————————————————————————————————————————————————————————————————————————————
  944. ;     Value parameter should contain the ID of the picture you wish to display when        
  945. ;     creating controls of this type. If you don't want the control tracked at all, use     
  946. ;     the 'no track' variant.                                                                
  947.  
  948.                                                             ; Picture control proc IDs 
  949. kControlPictureProc                EQU        304
  950. kControlPictureNoTrackProc        EQU        305                    ; immediately returns kControlPicturePart
  951. ; ——————————————————————————————————————————————————————————————————————————————————————
  952. ;     • ICON CONTROL (CDEF 20)                                                            
  953. ; ——————————————————————————————————————————————————————————————————————————————————————
  954. ;     Value parameter should contain the ID of the ICON or cicn you wish to display when    
  955. ;     creating controls of this type. If you don't want the control tracked at all, use     
  956. ;     the 'no track' variant.                                                                
  957. ;  Icon control proc IDs 
  958.  
  959. kControlIconProc                EQU        320
  960. kControlIconNoTrackProc            EQU        321                    ; immediately returns kControlIconPart
  961. kControlIconSuiteProc            EQU        322
  962. kControlIconSuiteNoTrackProc    EQU        323                    ; immediately returns kControlIconPart
  963.  
  964.                                                             ; icon ref controls may have either an icon, color icon, icon suite, or icon ref.
  965.                                                             ; for data other than icon, you must set the data by passing a
  966.                                                             ; ControlButtonContentInfo to SetControlData
  967. kControlIconRefProc                EQU        324
  968. kControlIconRefNoTrackProc        EQU        325                    ; immediately returns kControlIconPart
  969. ;  Tagged data supported by icon controls 
  970.  
  971. kControlIconTransformTag        EQU        'trfm'                ; IconTransformType
  972. kControlIconAlignmentTag        EQU        'algn'                ; IconAlignmentType
  973. ;  Tags available with appearance 1.1 or later 
  974.  
  975. kControlIconResourceIDTag        EQU        'ires'                ; SInt16 resource ID of icon to use
  976. kControlIconContentTag            EQU        'cont'                ; accepts a ControlButtonContentInfo
  977. ; ——————————————————————————————————————————————————————————————————————————————————————
  978. ;     • WINDOW HEADER (CDEF 21)                                                            
  979. ; ——————————————————————————————————————————————————————————————————————————————————————
  980.  
  981.                                                             ; Window Header proc IDs 
  982. kControlWindowHeaderProc        EQU        336                    ; normal header
  983. kControlWindowListViewHeaderProc EQU    337                    ; variant for list views - no bottom line
  984. ; ——————————————————————————————————————————————————————————————————————————————————————
  985. ;     • LIST BOX (CDEF 22)                                                                
  986. ; ——————————————————————————————————————————————————————————————————————————————————————
  987. ;     Lists use an auxiliary resource to define their format. The resource type used is     
  988. ;     'ldes' and a definition for it can be found in Appearance.r. The resource ID for     
  989. ;     the ldes is passed in the 'value' parameter when creating the control. You may pass 
  990. ;     zero in value. This tells the List Box control to not use a resource. The list will 
  991. ;     be created with default values, and will use the standard LDEF (0). You can change    
  992. ;     the list by getting the list handle. You can set the LDEF to use by using the tag    
  993. ;     below (kControlListBoxLDEFTag)                                                        
  994.  
  995.                                                             ; List Box proc IDs 
  996. kControlListBoxProc                EQU        352
  997. kControlListBoxAutoSizeProc        EQU        353
  998.  
  999.                                                             ; Tagged data supported by list box 
  1000. kControlListBoxListHandleTag    EQU        'lhan'                ; ListHandle
  1001. kControlListBoxKeyFilterTag        EQU        'fltr'                ; ControlKeyFilterUPP
  1002. kControlListBoxFontStyleTag        EQU        'font'                ; ControlFontStyleRec
  1003. ;  New tags in 1.0.1 or later 
  1004.  
  1005. kControlListBoxDoubleClickTag    EQU        'dblc'                ; Boolean. Was last click a double-click?
  1006. kControlListBoxLDEFTag            EQU        'ldef'                ; SInt16. ID of LDEF to use.
  1007. ; ——————————————————————————————————————————————————————————————————————————————————————
  1008. ;     • PUSH BUTTON (CDEF 23)                                                                
  1009. ; ——————————————————————————————————————————————————————————————————————————————————————
  1010. ;     The new standard checkbox and radio button controls support a "mixed" value that    
  1011. ;     indicates that the current setting contains a mixed set of on and off values. The     
  1012. ;     control value used to display this indication is defined in Controls.h:                
  1013. ;                                                                                         
  1014. ;         kControlCheckBoxMixedValue = 2                                                    
  1015. ;                                                                                         
  1016. ;     Two new variants of the standard pushbutton have been added to the standard control    
  1017. ;     suite that draw a color icon next to the control title. One variant draws the icon    
  1018. ;     on the left side, the other draws it on the right side (when the system justifica-    
  1019. ;     tion is right to left, these are reversed).                                            
  1020. ;                                                                                         
  1021. ;     When either of the icon pushbuttons are created, the contrlMax field of the control 
  1022. ;     record is used to determine the ID of the 'cicn' resource drawn in the pushbutton.    
  1023. ;                                                                                         
  1024. ;     In addition, a push button can now be told to draw with a default outline using the    
  1025. ;     SetControlData routine with the kPushButtonDefaultTag below.                        
  1026. ;                                                                                         
  1027. ;     A push button may also be marked using the kControlPushButtonCancelTag. This has    
  1028. ;     no visible representation, but does cause the button to play the CancelButton theme    
  1029. ;     sound instead of the regular pushbutton theme sound when pressed.                    
  1030. ;                                                                                         
  1031.  
  1032.                                                             ; Theme Push Button/Check Box/Radio Button proc IDs 
  1033. kControlPushButtonProc            EQU        368
  1034. kControlCheckBoxProc            EQU        369
  1035. kControlRadioButtonProc            EQU        370
  1036. kControlPushButLeftIconProc        EQU        374                    ; Standard pushbutton with left-side icon
  1037. kControlPushButRightIconProc    EQU        375                    ; Standard pushbutton with right-side icon
  1038. ;  Variants with Appearance 1.1 or later 
  1039.  
  1040. kControlCheckBoxAutoToggleProc    EQU        371
  1041. kControlRadioButtonAutoToggleProc EQU    372
  1042.  
  1043.                                                             ; Tagged data supported by standard buttons 
  1044. kControlPushButtonDefaultTag    EQU        'dflt'                ; default ring flag
  1045.  
  1046. kControlPushButtonCancelTag        EQU        'cncl'                ; cancel button flag (1.1 and later)
  1047. ; ——————————————————————————————————————————————————————————————————————————————————————
  1048. ;     • SCROLL BAR (CDEF 24)                                                                
  1049. ; ——————————————————————————————————————————————————————————————————————————————————————
  1050. ;     This is the new Appearance scroll bar.                                                
  1051. ;                                                                                         
  1052.  
  1053.                                                             ; Theme Scroll Bar proc IDs 
  1054. kControlScrollBarProc            EQU        384                    ; normal scroll bar
  1055. kControlScrollBarLiveProc        EQU        386                    ; live scrolling variant
  1056. ; ——————————————————————————————————————————————————————————————————————————————————————
  1057. ;     • POPUP BUTTON (CDEF 25)                                                            
  1058. ; ——————————————————————————————————————————————————————————————————————————————————————
  1059. ;     This is the new Appearance Popup Button. It takes the same variants and does the     
  1060. ;     same overloading as the previous popup menu control. There are some differences:    
  1061. ;                                                                                         
  1062. ;     Passing in a menu ID of -12345 causes the popup not to try and get the menu from a    
  1063. ;     resource. Instead, you can build the menu and later stuff the menuhandle field in     
  1064. ;     the popup data information.                                                            
  1065. ;                                                                                         
  1066. ;     You can pass -1 in the Max parameter to have the control calculate the width of the    
  1067. ;     title on its own instead of guessing and then tweaking to get it right. It adds the    
  1068. ;     appropriate amount of space between the title and the popup.                        
  1069. ;                                                                                         
  1070.  
  1071.                                                             ; Theme Popup Button proc IDs 
  1072. kControlPopupButtonProc            EQU        400
  1073. kControlPopupFixedWidthVariant    EQU        $01
  1074. kControlPopupVariableWidthVariant EQU    $02
  1075. kControlPopupUseAddResMenuVariant EQU    $04
  1076. kControlPopupUseWFontVariant    EQU        $08                    ; kControlUsesOwningWindowsFontVariant
  1077. ;  These tags are available in 1.0.1 or later of Appearance 
  1078.  
  1079. kControlPopupButtonMenuHandleTag EQU    'mhan'                ; MenuHandle
  1080. kControlPopupButtonMenuIDTag    EQU        'mnid'                ; SInt16
  1081. ;  These tags are available in 1.1 or later of Appearance 
  1082.  
  1083. kControlPopupButtonExtraHeightTag EQU    'exht'                ; SInt16 extra vertical whitespace within the button
  1084. ; ——————————————————————————————————————————————————————————————————————————————————————
  1085. ;     • RADIO GROUP (CDEF 26)                                                                
  1086. ; ——————————————————————————————————————————————————————————————————————————————————————
  1087. ;     This control implements a radio group. It is an embedding control and can therefore    
  1088. ;      only be used when a control hierarchy is established for its owning window. You        
  1089. ;     should only embed radio buttons within it. As radio buttons are embedded into it,    
  1090. ;     the group sets up its value, min, and max to represent the number of embedded items.
  1091. ;     The current value of the control is the index of the sub-control that is the current
  1092. ;     'on' radio button. To get the current radio button control handle, you can use the    
  1093. ;     control manager call GetIndSubControl, passing in the value of the radio group.        
  1094. ;                                                                                         
  1095. ;     NOTE: This control is only available with Appearance 1.0.1.                            
  1096.  
  1097. kControlRadioGroupProc            EQU        416
  1098. ; ——————————————————————————————————————————————————————————————————————————————————————
  1099. ;     • SCROLL TEXT BOX (CDEF 27)                                                            
  1100. ; ——————————————————————————————————————————————————————————————————————————————————————
  1101. ;     This control implements a scrolling box of (non-editable) text.    This is useful for    
  1102. ;     credits in about boxes, etc.                                                        
  1103. ;     The standard version of this control has a scroll bar, but the autoscrolling        
  1104. ;     variant does not. The autoscrolling variant needs two pieces of information to        
  1105. ;     work: delay (in ticks) before the scrolling starts, and time (in ticks) between        
  1106. ;     scrolls. It will scroll one pixel at a time, unless changed via SetControlData.        
  1107. ;                                                                                         
  1108. ;     Parameter                    What Goes Here                                            
  1109. ;     ———————————————————            ————————————————————————————————————————————————————    
  1110. ;     Value                        Resource ID of 'TEXT'/'styl' content.                    
  1111. ;     Min                            Scroll start delay (in ticks)                        .    
  1112. ;     Max                            Delay (in ticks) between scrolls.                        
  1113. ;                                                                                         
  1114. ;     NOTE: This control is only available with Appearance 1.1.                            
  1115.  
  1116. kControlScrollTextBoxProc        EQU        432
  1117. kControlScrollTextBoxAutoScrollProc EQU    433
  1118.  
  1119. kControlScrollTextBoxDelayBeforeAutoScrollTag EQU 'stdl'    ; UInt32 (ticks until autoscrolling starts)
  1120. kControlScrollTextBoxDelayBetweenAutoScrollTag EQU 'scdl'    ; UInt32 (ticks between scrolls)
  1121. kControlScrollTextBoxAutoScrollAmountTag EQU 'samt'            ; UInt16 (pixels per scroll) -- defaults to 1
  1122. kControlScrollTextBoxContentsTag EQU    'tres'                ; SInt16 (resource ID of 'TEXT'/'styl') -- write only!
  1123.  
  1124. ;   —— end of stuff only available with Appearance 1.0 and later
  1125.  
  1126.  
  1127. ; ——————————————————————————————————————————————————————————————————————————————————————
  1128. ;     • Control Variants                                                                    
  1129. ; ——————————————————————————————————————————————————————————————————————————————————————
  1130. ; typedef SInt16                         ControlVariant
  1131.  
  1132.  
  1133. kControlNoVariant                EQU        0                    ; No variant
  1134. kControlUsesOwningWindowsFontVariant EQU $08                ; Control uses owning windows font to display text
  1135. ; ——————————————————————————————————————————————————————————————————————————————————————
  1136. ;     • Control Part Codes                                                                
  1137. ; ——————————————————————————————————————————————————————————————————————————————————————
  1138.  
  1139. kControlNoPart                    EQU        0
  1140. kControlLabelPart                EQU        1
  1141. kControlMenuPart                EQU        2
  1142. kControlTrianglePart            EQU        4
  1143. kControlEditTextPart            EQU        5                    ; Appearance 1.0 and later
  1144. kControlPicturePart                EQU        6                    ; Appearance 1.0 and later
  1145. kControlIconPart                EQU        7                    ; Appearance 1.0 and later
  1146. kControlClockPart                EQU        8                    ; Appearance 1.0 and later
  1147. kControlListBoxPart                EQU        24                    ; Appearance 1.0 and later
  1148. kControlListBoxDoubleClickPart    EQU        25                    ; Appearance 1.0 and later
  1149. kControlImageWellPart            EQU        26                    ; Appearance 1.0 and later
  1150. kControlRadioGroupPart            EQU        27                    ; Appearance 1.0.2 and later
  1151. kControlButtonPart                EQU        10
  1152. kControlCheckBoxPart            EQU        11
  1153. kControlRadioButtonPart            EQU        11
  1154. kControlUpButtonPart            EQU        20
  1155. kControlDownButtonPart            EQU        21
  1156. kControlPageUpPart                EQU        22
  1157. kControlPageDownPart            EQU        23
  1158. kControlIndicatorPart            EQU        129
  1159. kControlDisabledPart            EQU        254
  1160. kControlInactivePart            EQU        255
  1161.  
  1162. kControlClockHourDayPart        EQU        9                    ; Appearance 1.1 and later
  1163. kControlClockMinuteMonthPart    EQU        10                    ; Appearance 1.1 and later
  1164. kControlClockSecondYearPart        EQU        11                    ; Appearance 1.1 and later
  1165. kControlClockAMPMPart            EQU        12                    ; Appearance 1.1 and later
  1166. ; ——————————————————————————————————————————————————————————————————————————————————————
  1167. ;      Meta-Parts                                                                            
  1168. ;/*     If you haven't guessed from looking at other toolbox headers. We like the word         
  1169. ;     'meta'. It's cool. So here's one more for you. A meta-part is a part used in a call    
  1170. ;      to the GetControlRegion API. These parts are parts that might be defined by a        
  1171. ;     control, but should not be returned from calls like TestControl, et al. They define    
  1172. ;      a region of a control, presently the structure and the content region. The content    
  1173. ;      region is only defined by controls that can embed other controls. It is the area    
  1174. ;      that embedded content can live.                                                        
  1175. ;                                                                                         
  1176. ;     Along with these parts, you can also pass in normal part codes to get the regions    
  1177. ;      of the parts. Not all controls fully support this at the time this was written.        
  1178. ; ——————————————————————————————————————————————————————————————————————————————————————
  1179.  
  1180. kControlStructureMetaPart        EQU        -1
  1181. kControlContentMetaPart            EQU        -2
  1182. ; ——————————————————————————————————————————————————————————————————————————————————————
  1183. ;     • Check Box Values                                                                    
  1184. ; ——————————————————————————————————————————————————————————————————————————————————————
  1185.  
  1186. kControlCheckBoxUncheckedValue    EQU        0
  1187. kControlCheckBoxCheckedValue    EQU        1
  1188. kControlCheckBoxMixedValue        EQU        2
  1189. ; ——————————————————————————————————————————————————————————————————————————————————————
  1190. ;     • Radio Button Values                                                                
  1191. ; ——————————————————————————————————————————————————————————————————————————————————————
  1192.  
  1193. kControlRadioButtonUncheckedValue EQU    0
  1194. kControlRadioButtonCheckedValue    EQU        1
  1195. kControlRadioButtonMixedValue    EQU        2
  1196. ; ——————————————————————————————————————————————————————————————————————————————————————
  1197. ;     • Pop-Up Menu Control Constants                                                        
  1198. ; ——————————————————————————————————————————————————————————————————————————————————————
  1199. ;  Variant codes for the System 7 pop-up menu
  1200.  
  1201. popupFixedWidth                    EQU        $01
  1202. popupVariableWidth                EQU        $02
  1203. popupUseAddResMenu                EQU        $04
  1204. popupUseWFont                    EQU        $08
  1205. ;  Menu label styles for the System 7 pop-up menu
  1206.  
  1207. popupTitleBold                    EQU        $0100
  1208. popupTitleItalic                EQU        $0200
  1209. popupTitleUnderline                EQU        $0400
  1210. popupTitleOutline                EQU        $0800
  1211. popupTitleShadow                EQU        $1000
  1212. popupTitleCondense                EQU        $2000
  1213. popupTitleExtend                EQU        $4000
  1214. popupTitleNoStyle                EQU        $8000
  1215. ;  Menu label justifications for the System 7 pop-up menu
  1216.  
  1217. popupTitleLeftJust                EQU        $00000000
  1218. popupTitleCenterJust            EQU        $00000001
  1219. popupTitleRightJust                EQU        $000000FF
  1220. ; ——————————————————————————————————————————————————————————————————————————————————————
  1221. ;      • DragGrayRgn Constatns                                                                
  1222. ;                                                                                         
  1223. ;    For DragGrayRgnUPP used in TrackControl()                                             
  1224. ; ——————————————————————————————————————————————————————————————————————————————————————
  1225.  
  1226. noConstraint                    EQU        0
  1227. hAxisOnly                        EQU        1
  1228. vAxisOnly                        EQU        2
  1229. ; ——————————————————————————————————————————————————————————————————————————————————————
  1230. ;     • Control Creation/Deletion                                                            
  1231. ; ——————————————————————————————————————————————————————————————————————————————————————
  1232. ;
  1233. ; pascal ControlHandle NewControl(WindowPtr owningWindow, const Rect *boundsRect, ConstStr255Param controlTitle, Boolean initiallyVisible, SInt16 initialValue, SInt16 minimumValue, SInt16 maximumValue, SInt16 procID, SInt32 controlReference)
  1234. ;
  1235.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1236.         _NewControl:    OPWORD    $A954
  1237.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1238.         IMPORT_CFM_FUNCTION NewControl
  1239.     ENDIF
  1240.  
  1241. ;
  1242. ; pascal ControlHandle GetNewControl(SInt16 resourceID, WindowPtr owningWindow)
  1243. ;
  1244.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1245.         _GetNewControl:    OPWORD    $A9BE
  1246.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1247.         IMPORT_CFM_FUNCTION GetNewControl
  1248.     ENDIF
  1249.  
  1250. ;
  1251. ; pascal void DisposeControl(ControlHandle theControl)
  1252. ;
  1253.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1254.         _DisposeControl:    OPWORD    $A955
  1255.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1256.         IMPORT_CFM_FUNCTION DisposeControl
  1257.     ENDIF
  1258.  
  1259. ;
  1260. ; pascal void KillControls(WindowPtr theWindow)
  1261. ;
  1262.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1263.         _KillControls:    OPWORD    $A956
  1264.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1265.         IMPORT_CFM_FUNCTION KillControls
  1266.     ENDIF
  1267.  
  1268. ; ——————————————————————————————————————————————————————————————————————————————————————
  1269. ;     • Control Visible State                                                                
  1270. ; ——————————————————————————————————————————————————————————————————————————————————————
  1271. ;
  1272. ; pascal void HiliteControl(ControlHandle theControl, ControlPartCode hiliteState)
  1273. ;
  1274.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1275.         _HiliteControl:    OPWORD    $A95D
  1276.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1277.         IMPORT_CFM_FUNCTION HiliteControl
  1278.     ENDIF
  1279.  
  1280. ;
  1281. ; pascal void ShowControl(ControlHandle theControl)
  1282. ;
  1283.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1284.         _ShowControl:    OPWORD    $A957
  1285.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1286.         IMPORT_CFM_FUNCTION ShowControl
  1287.     ENDIF
  1288.  
  1289. ;
  1290. ; pascal void HideControl(ControlHandle theControl)
  1291. ;
  1292.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1293.         _HideControl:    OPWORD    $A958
  1294.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1295.         IMPORT_CFM_FUNCTION HideControl
  1296.     ENDIF
  1297.  
  1298.  
  1299. ;  following state routines available only with Appearance 1.0 and later
  1300. ;
  1301. ; pascal Boolean IsControlActive(ControlHandle inControl)
  1302. ;
  1303.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1304.         Macro
  1305.         _IsControlActive
  1306.             move.w              #$0005,D0
  1307.             dc.w                $AA73
  1308.         EndM
  1309.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1310.         IMPORT_CFM_FUNCTION IsControlActive
  1311.     ENDIF
  1312.  
  1313. ;
  1314. ; pascal Boolean IsControlVisible(ControlHandle inControl)
  1315. ;
  1316.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1317.         Macro
  1318.         _IsControlVisible
  1319.             move.w              #$0006,D0
  1320.             dc.w                $AA73
  1321.         EndM
  1322.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1323.         IMPORT_CFM_FUNCTION IsControlVisible
  1324.     ENDIF
  1325.  
  1326. ;
  1327. ; pascal OSErr ActivateControl(ControlHandle inControl)
  1328. ;
  1329.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1330.         Macro
  1331.         _ActivateControl
  1332.             move.w              #$0007,D0
  1333.             dc.w                $AA73
  1334.         EndM
  1335.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1336.         IMPORT_CFM_FUNCTION ActivateControl
  1337.     ENDIF
  1338.  
  1339. ;
  1340. ; pascal OSErr DeactivateControl(ControlHandle inControl)
  1341. ;
  1342.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1343.         Macro
  1344.         _DeactivateControl
  1345.             move.w              #$0008,D0
  1346.             dc.w                $AA73
  1347.         EndM
  1348.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1349.         IMPORT_CFM_FUNCTION DeactivateControl
  1350.     ENDIF
  1351.  
  1352. ;
  1353. ; pascal OSErr SetControlVisibility(ControlHandle inControl, Boolean inIsVisible, Boolean inDoDraw)
  1354. ;
  1355.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1356.         Macro
  1357.         _SetControlVisibility
  1358.             move.w              #$001E,D0
  1359.             dc.w                $AA73
  1360.         EndM
  1361.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1362.         IMPORT_CFM_FUNCTION SetControlVisibility
  1363.     ENDIF
  1364.  
  1365.  
  1366. ; ——————————————————————————————————————————————————————————————————————————————————————
  1367. ;     • Control Imaging                                                                    
  1368. ; ——————————————————————————————————————————————————————————————————————————————————————
  1369. ;
  1370. ; pascal void DrawControls(WindowPtr theWindow)
  1371. ;
  1372.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1373.         _DrawControls:    OPWORD    $A969
  1374.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1375.         IMPORT_CFM_FUNCTION DrawControls
  1376.     ENDIF
  1377.  
  1378. ;
  1379. ; pascal void Draw1Control(ControlHandle theControl)
  1380. ;
  1381.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1382.         _Draw1Control:    OPWORD    $A96D
  1383.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1384.         IMPORT_CFM_FUNCTION Draw1Control
  1385.     ENDIF
  1386.  
  1387.  
  1388. ;
  1389. ; pascal void UpdateControls(WindowPtr theWindow, RgnHandle updateRegion)
  1390. ;
  1391.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1392.         _UpdateControls:    OPWORD    $A953
  1393.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1394.         IMPORT_CFM_FUNCTION UpdateControls
  1395.     ENDIF
  1396.  
  1397.  
  1398. ;  following imaging routines available only with Appearance 1.0 and later
  1399. ;
  1400. ; pascal OSErr GetBestControlRect(ControlHandle inControl, Rect *outRect, SInt16 *outBaseLineOffset)
  1401. ;
  1402.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1403.         Macro
  1404.         _GetBestControlRect
  1405.             move.w              #$001B,D0
  1406.             dc.w                $AA73
  1407.         EndM
  1408.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1409.         IMPORT_CFM_FUNCTION GetBestControlRect
  1410.     ENDIF
  1411.  
  1412. ;
  1413. ; pascal OSErr SetControlFontStyle(ControlHandle inControl, const ControlFontStyleRec *inStyle)
  1414. ;
  1415.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1416.         Macro
  1417.         _SetControlFontStyle
  1418.             move.w              #$001C,D0
  1419.             dc.w                $AA73
  1420.         EndM
  1421.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1422.         IMPORT_CFM_FUNCTION SetControlFontStyle
  1423.     ENDIF
  1424.  
  1425. ;
  1426. ; pascal void DrawControlInCurrentPort(ControlHandle inControl)
  1427. ;
  1428.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1429.         Macro
  1430.         _DrawControlInCurrentPort
  1431.             move.w              #$0018,D0
  1432.             dc.w                $AA73
  1433.         EndM
  1434.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1435.         IMPORT_CFM_FUNCTION DrawControlInCurrentPort
  1436.     ENDIF
  1437.  
  1438. ;
  1439. ; pascal OSErr SetUpControlBackground(ControlHandle inControl, SInt16 inDepth, Boolean inIsColorDevice)
  1440. ;
  1441.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1442.         Macro
  1443.         _SetUpControlBackground
  1444.             move.w              #$001D,D0
  1445.             dc.w                $AA73
  1446.         EndM
  1447.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1448.         IMPORT_CFM_FUNCTION SetUpControlBackground
  1449.     ENDIF
  1450.  
  1451. ;  SetUpControlTextColor is available in Appearance 1.1 or later.
  1452. ;
  1453. ; pascal OSErr SetUpControlTextColor(ControlHandle inControl, SInt16 inDepth, Boolean inIsColorDevice)
  1454. ;
  1455.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1456.         IMPORT_CFM_FUNCTION SetUpControlTextColor
  1457.     ENDIF
  1458.  
  1459.  
  1460. ; ——————————————————————————————————————————————————————————————————————————————————————
  1461. ;     • Control Mousing                                                                    
  1462. ; ——————————————————————————————————————————————————————————————————————————————————————
  1463. ;    NOTE ON CONTROL ACTION PROCS
  1464. ;
  1465. ;    When using the TrackControl() call when tracking an indicator, the actionProc parameter
  1466. ;    (type ControlActionUPP) should be replaced by a parameter of type DragGrayRgnUPP
  1467. ;    (see Quickdraw.h).
  1468. ;
  1469. ;    If, however, you are using the live feedback variants of scroll bars or sliders, you
  1470. ;    can pass a ControlActionUPP in when tracking the indicator as well. This functionality
  1471. ;    is available in Appearance 1.0 or later.
  1472. ;
  1473.  
  1474. ;
  1475. ; pascal ControlPartCode TrackControl(ControlHandle theControl, Point startPoint, ControlActionUPP actionProc)
  1476. ;
  1477.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1478.         _TrackControl:    OPWORD    $A968
  1479.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1480.         IMPORT_CFM_FUNCTION TrackControl
  1481.     ENDIF
  1482.  
  1483. ;
  1484. ; pascal void DragControl(ControlHandle theControl, Point startPoint, const Rect *limitRect, const Rect *slopRect, DragConstraint axis)
  1485. ;
  1486.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1487.         _DragControl:    OPWORD    $A967
  1488.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1489.         IMPORT_CFM_FUNCTION DragControl
  1490.     ENDIF
  1491.  
  1492. ;
  1493. ; pascal ControlPartCode TestControl(ControlHandle theControl, Point testPoint)
  1494. ;
  1495.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1496.         _TestControl:    OPWORD    $A966
  1497.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1498.         IMPORT_CFM_FUNCTION TestControl
  1499.     ENDIF
  1500.  
  1501. ;
  1502. ; pascal ControlPartCode FindControl(Point testPoint, WindowPtr theWindow, ControlHandle *theControl)
  1503. ;
  1504.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1505.         _FindControl:    OPWORD    $A96C
  1506.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1507.         IMPORT_CFM_FUNCTION FindControl
  1508.     ENDIF
  1509.  
  1510. ;  The following mousing routines available only with Appearance 1.0 and later    
  1511. ;                                                                                 
  1512. ;  FindControlUnderMouse is preferrable to TrackControl when running under        
  1513. ;  Appearance 1.0 as you can pass in modifiers, which some of the new controls    
  1514. ;  use, such as edit text and list boxes.                                        
  1515. ;
  1516. ; pascal ControlHandle FindControlUnderMouse(Point inWhere, WindowPtr inWindow, SInt16 *outPart)
  1517. ;
  1518.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1519.         Macro
  1520.         _FindControlUnderMouse
  1521.             move.w              #$0009,D0
  1522.             dc.w                $AA73
  1523.         EndM
  1524.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1525.         IMPORT_CFM_FUNCTION FindControlUnderMouse
  1526.     ENDIF
  1527.  
  1528. ;
  1529. ; pascal ControlPartCode HandleControlClick(ControlHandle inControl, Point inWhere, SInt16 inModifiers, ControlActionUPP inAction)
  1530. ;
  1531.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1532.         Macro
  1533.         _HandleControlClick
  1534.             move.w              #$000A,D0
  1535.             dc.w                $AA73
  1536.         EndM
  1537.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1538.         IMPORT_CFM_FUNCTION HandleControlClick
  1539.     ENDIF
  1540.  
  1541.  
  1542.  
  1543.  
  1544. ; ——————————————————————————————————————————————————————————————————————————————————————
  1545. ;     • Control Events (available only with Appearance 1.0 and later)                        
  1546. ; ——————————————————————————————————————————————————————————————————————————————————————
  1547. ;
  1548. ; pascal SInt16 HandleControlKey(ControlHandle inControl, SInt16 inKeyCode, SInt16 inCharCode, SInt16 inModifiers)
  1549. ;
  1550.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1551.         Macro
  1552.         _HandleControlKey
  1553.             move.w              #$000B,D0
  1554.             dc.w                $AA73
  1555.         EndM
  1556.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1557.         IMPORT_CFM_FUNCTION HandleControlKey
  1558.     ENDIF
  1559.  
  1560. ;
  1561. ; pascal void IdleControls(WindowPtr inWindow)
  1562. ;
  1563.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1564.         Macro
  1565.         _IdleControls
  1566.             move.w              #$000C,D0
  1567.             dc.w                $AA73
  1568.         EndM
  1569.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1570.         IMPORT_CFM_FUNCTION IdleControls
  1571.     ENDIF
  1572.  
  1573.  
  1574.  
  1575. ; ——————————————————————————————————————————————————————————————————————————————————————
  1576. ;     • Control Positioning                                                                
  1577. ; ——————————————————————————————————————————————————————————————————————————————————————
  1578. ;
  1579. ; pascal void MoveControl(ControlHandle theControl, SInt16 h, SInt16 v)
  1580. ;
  1581.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1582.         _MoveControl:    OPWORD    $A959
  1583.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1584.         IMPORT_CFM_FUNCTION MoveControl
  1585.     ENDIF
  1586.  
  1587. ;
  1588. ; pascal void SizeControl(ControlHandle theControl, SInt16 w, SInt16 h)
  1589. ;
  1590.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1591.         _SizeControl:    OPWORD    $A95C
  1592.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1593.         IMPORT_CFM_FUNCTION SizeControl
  1594.     ENDIF
  1595.  
  1596. ; ——————————————————————————————————————————————————————————————————————————————————————
  1597. ;     • Control Title                                                                        
  1598. ; ——————————————————————————————————————————————————————————————————————————————————————
  1599. ;
  1600. ; pascal void SetControlTitle(ControlHandle theControl, ConstStr255Param title)
  1601. ;
  1602.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1603.         _SetControlTitle:    OPWORD    $A95F
  1604.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1605.         IMPORT_CFM_FUNCTION SetControlTitle
  1606.     ENDIF
  1607.  
  1608. ;
  1609. ; pascal void GetControlTitle(ControlHandle theControl, Str255 title)
  1610. ;
  1611.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1612.         _GetControlTitle:    OPWORD    $A95E
  1613.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1614.         IMPORT_CFM_FUNCTION GetControlTitle
  1615.     ENDIF
  1616.  
  1617. ; ——————————————————————————————————————————————————————————————————————————————————————
  1618. ;     • Control Value                                                                        
  1619. ; ——————————————————————————————————————————————————————————————————————————————————————
  1620. ;
  1621. ; pascal SInt16 GetControlValue(ControlHandle theControl)
  1622. ;
  1623.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1624.         _GetControlValue:    OPWORD    $A960
  1625.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1626.         IMPORT_CFM_FUNCTION GetControlValue
  1627.     ENDIF
  1628.  
  1629. ;
  1630. ; pascal void SetControlValue(ControlHandle theControl, SInt16 newValue)
  1631. ;
  1632.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1633.         _SetControlValue:    OPWORD    $A963
  1634.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1635.         IMPORT_CFM_FUNCTION SetControlValue
  1636.     ENDIF
  1637.  
  1638. ;
  1639. ; pascal SInt16 GetControlMinimum(ControlHandle theControl)
  1640. ;
  1641.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1642.         _GetControlMinimum:    OPWORD    $A961
  1643.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1644.         IMPORT_CFM_FUNCTION GetControlMinimum
  1645.     ENDIF
  1646.  
  1647. ;
  1648. ; pascal void SetControlMinimum(ControlHandle theControl, SInt16 newMinimum)
  1649. ;
  1650.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1651.         _SetControlMinimum:    OPWORD    $A964
  1652.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1653.         IMPORT_CFM_FUNCTION SetControlMinimum
  1654.     ENDIF
  1655.  
  1656. ;
  1657. ; pascal SInt16 GetControlMaximum(ControlHandle theControl)
  1658. ;
  1659.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1660.         _GetControlMaximum:    OPWORD    $A962
  1661.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1662.         IMPORT_CFM_FUNCTION GetControlMaximum
  1663.     ENDIF
  1664.  
  1665. ;
  1666. ; pascal void SetControlMaximum(ControlHandle theControl, SInt16 newMaximum)
  1667. ;
  1668.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1669.         _SetControlMaximum:    OPWORD    $A965
  1670.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1671.         IMPORT_CFM_FUNCTION SetControlMaximum
  1672.     ENDIF
  1673.  
  1674. ;  proportional scrolling/32-bit value support is new with Appearance 1.1
  1675. ;
  1676. ; pascal SInt32 GetControlViewSize(ControlHandle theControl)
  1677. ;
  1678.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1679.         IMPORT_CFM_FUNCTION GetControlViewSize
  1680.     ENDIF
  1681.  
  1682. ;
  1683. ; pascal void SetControlViewSize(ControlHandle theControl, SInt32 newViewSize)
  1684. ;
  1685.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1686.         IMPORT_CFM_FUNCTION SetControlViewSize
  1687.     ENDIF
  1688.  
  1689. ;
  1690. ; pascal SInt32 GetControl32BitValue(ControlHandle theControl)
  1691. ;
  1692.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1693.         IMPORT_CFM_FUNCTION GetControl32BitValue
  1694.     ENDIF
  1695.  
  1696. ;
  1697. ; pascal void SetControl32BitValue(ControlHandle theControl, SInt32 newValue)
  1698. ;
  1699.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1700.         IMPORT_CFM_FUNCTION SetControl32BitValue
  1701.     ENDIF
  1702.  
  1703. ;
  1704. ; pascal SInt32 GetControl32BitMaximum(ControlHandle theControl)
  1705. ;
  1706.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1707.         IMPORT_CFM_FUNCTION GetControl32BitMaximum
  1708.     ENDIF
  1709.  
  1710. ;
  1711. ; pascal void SetControl32BitMaximum(ControlHandle theControl, SInt32 newMaximum)
  1712. ;
  1713.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1714.         IMPORT_CFM_FUNCTION SetControl32BitMaximum
  1715.     ENDIF
  1716.  
  1717. ;
  1718. ; pascal SInt32 GetControl32BitMinimum(ControlHandle theControl)
  1719. ;
  1720.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1721.         IMPORT_CFM_FUNCTION GetControl32BitMinimum
  1722.     ENDIF
  1723.  
  1724. ;
  1725. ; pascal void SetControl32BitMinimum(ControlHandle theControl, SInt32 newMinimum)
  1726. ;
  1727.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1728.         IMPORT_CFM_FUNCTION SetControl32BitMinimum
  1729.     ENDIF
  1730.  
  1731.  
  1732. ;       IsValidControlHandle will tell you if the handle you pass in belongs to a control
  1733. ;      the Control Manager knows about. It does not sanity check the data in the control.
  1734.  
  1735.  
  1736.  
  1737. ;
  1738. ; pascal Boolean IsValidControlHandle(ControlHandle theControl)
  1739. ;
  1740.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1741.         IMPORT_CFM_FUNCTION IsValidControlHandle
  1742.     ENDIF
  1743.  
  1744. ; ——————————————————————————————————————————————————————————————————————————————————————
  1745. ;  • Properties                                                                            
  1746. ; ——————————————————————————————————————————————————————————————————————————————————————
  1747. ;
  1748. ; pascal OSStatus GetControlProperty(ControlHandle control, OSType propertyCreator, OSType propertyTag, UInt32 bufferSize, UInt32 *actualSize, void *propertyBuffer)
  1749. ;
  1750.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1751.         IMPORT_CFM_FUNCTION GetControlProperty
  1752.     ENDIF
  1753.  
  1754. ;
  1755. ; pascal OSStatus GetControlPropertySize(ControlHandle control, OSType propertyCreator, OSType propertyTag, UInt32 *size)
  1756. ;
  1757.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1758.         IMPORT_CFM_FUNCTION GetControlPropertySize
  1759.     ENDIF
  1760.  
  1761. ;
  1762. ; pascal OSStatus SetControlProperty(ControlHandle control, OSType propertyCreator, OSType propertyTag, UInt32 propertySize, void *propertyData)
  1763. ;
  1764.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1765.         IMPORT_CFM_FUNCTION SetControlProperty
  1766.     ENDIF
  1767.  
  1768. ;
  1769. ; pascal OSStatus RemoveControlProperty(ControlHandle control, OSType propertyCreator, OSType propertyTag)
  1770. ;
  1771.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1772.         IMPORT_CFM_FUNCTION RemoveControlProperty
  1773.     ENDIF
  1774.  
  1775.  
  1776. ; ——————————————————————————————————————————————————————————————————————————————————————
  1777. ;     • Control Regions (Appearance 1.1 or later)                                            
  1778. ;                                                                                         
  1779. ;     See the discussion on meta-parts in this header for more information                
  1780. ; ——————————————————————————————————————————————————————————————————————————————————————
  1781. ;
  1782. ; pascal OSStatus GetControlRegion(ControlHandle inControl, ControlPartCode inPart, RgnHandle outRegion)
  1783. ;
  1784.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1785.         IMPORT_CFM_FUNCTION GetControlRegion
  1786.     ENDIF
  1787.  
  1788. ; ——————————————————————————————————————————————————————————————————————————————————————
  1789. ;     • Control Variant                                                                    
  1790. ; ——————————————————————————————————————————————————————————————————————————————————————
  1791. ;
  1792. ; pascal ControlVariant GetControlVariant(ControlHandle theControl)
  1793. ;
  1794.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1795.         _GetControlVariant:    OPWORD    $A809
  1796.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1797.         IMPORT_CFM_FUNCTION GetControlVariant
  1798.     ENDIF
  1799.  
  1800. ; ——————————————————————————————————————————————————————————————————————————————————————
  1801. ;     • Control Action                                                                    
  1802. ; ——————————————————————————————————————————————————————————————————————————————————————
  1803. ;
  1804. ; pascal void SetControlAction(ControlHandle theControl, ControlActionUPP actionProc)
  1805. ;
  1806.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1807.         _SetControlAction:    OPWORD    $A96B
  1808.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1809.         IMPORT_CFM_FUNCTION SetControlAction
  1810.     ENDIF
  1811.  
  1812. ;
  1813. ; pascal ControlActionUPP GetControlAction(ControlHandle theControl)
  1814. ;
  1815.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1816.         _GetControlAction:    OPWORD    $A96A
  1817.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1818.         IMPORT_CFM_FUNCTION GetControlAction
  1819.     ENDIF
  1820.  
  1821. ; ——————————————————————————————————————————————————————————————————————————————————————
  1822. ;  • Control Accessors                                                                    
  1823. ; ——————————————————————————————————————————————————————————————————————————————————————
  1824. ;
  1825. ; pascal void SetControlReference(ControlHandle theControl, SInt32 data)
  1826. ;
  1827.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1828.         _SetControlReference:    OPWORD    $A95B
  1829.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1830.         IMPORT_CFM_FUNCTION SetControlReference
  1831.     ENDIF
  1832.  
  1833. ;
  1834. ; pascal SInt32 GetControlReference(ControlHandle theControl)
  1835. ;
  1836.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1837.         _GetControlReference:    OPWORD    $A95A
  1838.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1839.         IMPORT_CFM_FUNCTION GetControlReference
  1840.     ENDIF
  1841.  
  1842. ;
  1843. ; pascal Boolean GetAuxiliaryControlRecord(ControlHandle theControl, AuxCtlHandle *acHndl)
  1844. ;
  1845.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1846.         _GetAuxiliaryControlRecord:    OPWORD    $AA44
  1847.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1848.         IMPORT_CFM_FUNCTION GetAuxiliaryControlRecord
  1849.     ENDIF
  1850.  
  1851. ;
  1852. ; pascal void SetControlColor(ControlHandle theControl, CCTabHandle newColorTable)
  1853. ;
  1854.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1855.         _SetControlColor:    OPWORD    $AA43
  1856.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1857.         IMPORT_CFM_FUNCTION SetControlColor
  1858.     ENDIF
  1859.  
  1860. ; ——————————————————————————————————————————————————————————————————————————————————————
  1861. ;     • HELPERS (available only with Appearance 1.0 and later)                            
  1862. ;                                                                                         
  1863. ;  These routines are available only thru the shared library/glue                        
  1864. ;  Bevel button routines                                                                
  1865. ; ——————————————————————————————————————————————————————————————————————————————————————
  1866.  
  1867. ;
  1868. ; pascal OSErr GetBevelButtonMenuValue(ControlHandle inButton, SInt16 *outValue)
  1869. ;
  1870.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1871.         IMPORT_CFM_FUNCTION GetBevelButtonMenuValue
  1872.     ENDIF
  1873.  
  1874. ;
  1875. ; pascal OSErr SetBevelButtonMenuValue(ControlHandle inButton, SInt16 inValue)
  1876. ;
  1877.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1878.         IMPORT_CFM_FUNCTION SetBevelButtonMenuValue
  1879.     ENDIF
  1880.  
  1881. ;
  1882. ; pascal OSErr GetBevelButtonMenuHandle(ControlHandle inButton, MenuHandle *outHandle)
  1883. ;
  1884.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1885.         IMPORT_CFM_FUNCTION GetBevelButtonMenuHandle
  1886.     ENDIF
  1887.  
  1888. ;
  1889. ; pascal OSErr GetBevelButtonContentInfo(ControlHandle inButton, ControlButtonContentInfoPtr outContent)
  1890. ;
  1891.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1892.         IMPORT_CFM_FUNCTION GetBevelButtonContentInfo
  1893.     ENDIF
  1894.  
  1895. ;
  1896. ; pascal OSErr SetBevelButtonContentInfo(ControlHandle inButton, ControlButtonContentInfoPtr inContent)
  1897. ;
  1898.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1899.         IMPORT_CFM_FUNCTION SetBevelButtonContentInfo
  1900.     ENDIF
  1901.  
  1902. ;
  1903. ; pascal OSErr SetBevelButtonTransform(ControlHandle inButton, IconTransformType transform)
  1904. ;
  1905.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1906.         IMPORT_CFM_FUNCTION SetBevelButtonTransform
  1907.     ENDIF
  1908.  
  1909. ;
  1910. ; pascal OSErr SetBevelButtonGraphicAlignment(ControlHandle inButton, ControlButtonGraphicAlignment inAlign, SInt16 inHOffset, SInt16 inVOffset)
  1911. ;
  1912.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1913.         IMPORT_CFM_FUNCTION SetBevelButtonGraphicAlignment
  1914.     ENDIF
  1915.  
  1916. ;
  1917. ; pascal OSErr SetBevelButtonTextAlignment(ControlHandle inButton, ControlButtonTextAlignment inAlign, SInt16 inHOffset)
  1918. ;
  1919.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1920.         IMPORT_CFM_FUNCTION SetBevelButtonTextAlignment
  1921.     ENDIF
  1922.  
  1923. ;
  1924. ; pascal OSErr SetBevelButtonTextPlacement(ControlHandle inButton, ControlButtonTextPlacement inWhere)
  1925. ;
  1926.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1927.         IMPORT_CFM_FUNCTION SetBevelButtonTextPlacement
  1928.     ENDIF
  1929.  
  1930. ;  Image well routines
  1931.  
  1932. ;
  1933. ; pascal OSErr GetImageWellContentInfo(ControlHandle inButton, ControlButtonContentInfoPtr outContent)
  1934. ;
  1935.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1936.         IMPORT_CFM_FUNCTION GetImageWellContentInfo
  1937.     ENDIF
  1938.  
  1939. ;
  1940. ; pascal OSErr SetImageWellContentInfo(ControlHandle inButton, ControlButtonContentInfoPtr inContent)
  1941. ;
  1942.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1943.         IMPORT_CFM_FUNCTION SetImageWellContentInfo
  1944.     ENDIF
  1945.  
  1946. ;
  1947. ; pascal OSErr SetImageWellTransform(ControlHandle inButton, IconTransformType inTransform)
  1948. ;
  1949.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1950.         IMPORT_CFM_FUNCTION SetImageWellTransform
  1951.     ENDIF
  1952.  
  1953. ;  Tab routines
  1954.  
  1955. ;
  1956. ; pascal OSErr GetTabContentRect(ControlHandle inTabControl, Rect *outContentRect)
  1957. ;
  1958.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1959.         IMPORT_CFM_FUNCTION GetTabContentRect
  1960.     ENDIF
  1961.  
  1962. ;
  1963. ; pascal OSErr SetTabEnabled(ControlHandle inTabControl, SInt16 inTabToHilite, Boolean inEnabled)
  1964. ;
  1965.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1966.         IMPORT_CFM_FUNCTION SetTabEnabled
  1967.     ENDIF
  1968.  
  1969. ;  Disclosure triangles
  1970.  
  1971. ;
  1972. ; pascal OSErr SetDisclosureTriangleLastValue(ControlHandle inTabControl, SInt16 inValue)
  1973. ;
  1974.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1975.         IMPORT_CFM_FUNCTION SetDisclosureTriangleLastValue
  1976.     ENDIF
  1977.  
  1978. ; ——————————————————————————————————————————————————————————————————————————————————————
  1979. ;     • Control Hierarchy (Appearance 1.0 and later only)                                    
  1980. ; ——————————————————————————————————————————————————————————————————————————————————————
  1981. ;
  1982. ; pascal SInt32 SendControlMessage(ControlHandle inControl, SInt16 inMessage, SInt32 inParam)
  1983. ;
  1984.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1985.         Macro
  1986.         _SendControlMessage
  1987.             move.w              #$FFFE,D0
  1988.             dc.w                $AA73
  1989.         EndM
  1990.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1991.         IMPORT_CFM_FUNCTION SendControlMessage
  1992.     ENDIF
  1993.  
  1994. ;
  1995. ; pascal OSErr DumpControlHierarchy(WindowPtr inWindow, const FSSpec *inDumpFile)
  1996. ;
  1997.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1998.         Macro
  1999.         _DumpControlHierarchy
  2000.             move.w              #$FFFF,D0
  2001.             dc.w                $AA73
  2002.         EndM
  2003.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2004.         IMPORT_CFM_FUNCTION DumpControlHierarchy
  2005.     ENDIF
  2006.  
  2007. ;
  2008. ; pascal OSErr CreateRootControl(WindowPtr inWindow, ControlHandle *outControl)
  2009. ;
  2010.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2011.         Macro
  2012.         _CreateRootControl
  2013.             move.w              #$0001,D0
  2014.             dc.w                $AA73
  2015.         EndM
  2016.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2017.         IMPORT_CFM_FUNCTION CreateRootControl
  2018.     ENDIF
  2019.  
  2020. ;
  2021. ; pascal OSErr GetRootControl(WindowPtr inWindow, ControlHandle *outControl)
  2022. ;
  2023.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2024.         Macro
  2025.         _GetRootControl
  2026.             move.w              #$0002,D0
  2027.             dc.w                $AA73
  2028.         EndM
  2029.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2030.         IMPORT_CFM_FUNCTION GetRootControl
  2031.     ENDIF
  2032.  
  2033. ;
  2034. ; pascal OSErr EmbedControl(ControlHandle inControl, ControlHandle inContainer)
  2035. ;
  2036.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2037.         Macro
  2038.         _EmbedControl
  2039.             move.w              #$0003,D0
  2040.             dc.w                $AA73
  2041.         EndM
  2042.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2043.         IMPORT_CFM_FUNCTION EmbedControl
  2044.     ENDIF
  2045.  
  2046. ;
  2047. ; pascal OSErr AutoEmbedControl(ControlHandle inControl, WindowPtr inWindow)
  2048. ;
  2049.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2050.         Macro
  2051.         _AutoEmbedControl
  2052.             move.w              #$0004,D0
  2053.             dc.w                $AA73
  2054.         EndM
  2055.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2056.         IMPORT_CFM_FUNCTION AutoEmbedControl
  2057.     ENDIF
  2058.  
  2059. ;
  2060. ; pascal OSErr GetSuperControl(ControlHandle inControl, ControlHandle *outParent)
  2061. ;
  2062.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2063.         Macro
  2064.         _GetSuperControl
  2065.             move.w              #$0015,D0
  2066.             dc.w                $AA73
  2067.         EndM
  2068.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2069.         IMPORT_CFM_FUNCTION GetSuperControl
  2070.     ENDIF
  2071.  
  2072. ;
  2073. ; pascal OSErr CountSubControls(ControlHandle inControl, UInt16 *outNumChildren)
  2074. ;
  2075.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2076.         Macro
  2077.         _CountSubControls
  2078.             move.w              #$0016,D0
  2079.             dc.w                $AA73
  2080.         EndM
  2081.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2082.         IMPORT_CFM_FUNCTION CountSubControls
  2083.     ENDIF
  2084.  
  2085. ;
  2086. ; pascal OSErr GetIndexedSubControl(ControlHandle inControl, UInt16 inIndex, ControlHandle *outSubControl)
  2087. ;
  2088.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2089.         Macro
  2090.         _GetIndexedSubControl
  2091.             move.w              #$0017,D0
  2092.             dc.w                $AA73
  2093.         EndM
  2094.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2095.         IMPORT_CFM_FUNCTION GetIndexedSubControl
  2096.     ENDIF
  2097.  
  2098. ;
  2099. ; pascal OSErr SetControlSupervisor(ControlHandle inControl, ControlHandle inBoss)
  2100. ;
  2101.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2102.         Macro
  2103.         _SetControlSupervisor
  2104.             move.w              #$001A,D0
  2105.             dc.w                $AA73
  2106.         EndM
  2107.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2108.         IMPORT_CFM_FUNCTION SetControlSupervisor
  2109.     ENDIF
  2110.  
  2111.  
  2112.  
  2113. ; ——————————————————————————————————————————————————————————————————————————————————————
  2114. ;     • Keyboard Focus (available only with Appearance 1.0 and later)                        
  2115. ; ——————————————————————————————————————————————————————————————————————————————————————
  2116. ;
  2117. ; pascal OSErr GetKeyboardFocus(WindowPtr inWindow, ControlHandle *outControl)
  2118. ;
  2119.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2120.         Macro
  2121.         _GetKeyboardFocus
  2122.             move.w              #$000D,D0
  2123.             dc.w                $AA73
  2124.         EndM
  2125.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2126.         IMPORT_CFM_FUNCTION GetKeyboardFocus
  2127.     ENDIF
  2128.  
  2129. ;
  2130. ; pascal OSErr SetKeyboardFocus(WindowPtr inWindow, ControlHandle inControl, ControlFocusPart inPart)
  2131. ;
  2132.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2133.         Macro
  2134.         _SetKeyboardFocus
  2135.             move.w              #$000E,D0
  2136.             dc.w                $AA73
  2137.         EndM
  2138.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2139.         IMPORT_CFM_FUNCTION SetKeyboardFocus
  2140.     ENDIF
  2141.  
  2142. ;
  2143. ; pascal OSErr AdvanceKeyboardFocus(WindowPtr inWindow)
  2144. ;
  2145.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2146.         Macro
  2147.         _AdvanceKeyboardFocus
  2148.             move.w              #$000F,D0
  2149.             dc.w                $AA73
  2150.         EndM
  2151.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2152.         IMPORT_CFM_FUNCTION AdvanceKeyboardFocus
  2153.     ENDIF
  2154.  
  2155. ;
  2156. ; pascal OSErr ReverseKeyboardFocus(WindowPtr inWindow)
  2157. ;
  2158.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2159.         Macro
  2160.         _ReverseKeyboardFocus
  2161.             move.w              #$0010,D0
  2162.             dc.w                $AA73
  2163.         EndM
  2164.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2165.         IMPORT_CFM_FUNCTION ReverseKeyboardFocus
  2166.     ENDIF
  2167.  
  2168. ;
  2169. ; pascal OSErr ClearKeyboardFocus(WindowPtr inWindow)
  2170. ;
  2171.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2172.         Macro
  2173.         _ClearKeyboardFocus
  2174.             move.w              #$0019,D0
  2175.             dc.w                $AA73
  2176.         EndM
  2177.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2178.         IMPORT_CFM_FUNCTION ClearKeyboardFocus
  2179.     ENDIF
  2180.  
  2181.  
  2182.  
  2183. ; ——————————————————————————————————————————————————————————————————————————————————————
  2184. ;     • Control Data (available only with Appearance 1.0 and later)                        
  2185. ; ——————————————————————————————————————————————————————————————————————————————————————
  2186.  
  2187. ;
  2188. ; pascal OSErr GetControlFeatures(ControlHandle inControl, UInt32 *outFeatures)
  2189. ;
  2190.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2191.         Macro
  2192.         _GetControlFeatures
  2193.             move.w              #$0011,D0
  2194.             dc.w                $AA73
  2195.         EndM
  2196.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2197.         IMPORT_CFM_FUNCTION GetControlFeatures
  2198.     ENDIF
  2199.  
  2200. ;
  2201. ; pascal OSErr SetControlData(ControlHandle inControl, ControlPartCode inPart, ResType inTagName, Size inSize, Ptr inData)
  2202. ;
  2203.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2204.         Macro
  2205.         _SetControlData
  2206.             move.w              #$0012,D0
  2207.             dc.w                $AA73
  2208.         EndM
  2209.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2210.         IMPORT_CFM_FUNCTION SetControlData
  2211.     ENDIF
  2212.  
  2213. ;
  2214. ; pascal OSErr GetControlData(ControlHandle inControl, ControlPartCode inPart, ResType inTagName, Size inBufferSize, Ptr inBuffer, Size *outActualSize)
  2215. ;
  2216.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2217.         Macro
  2218.         _GetControlData
  2219.             move.w              #$0013,D0
  2220.             dc.w                $AA73
  2221.         EndM
  2222.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2223.         IMPORT_CFM_FUNCTION GetControlData
  2224.     ENDIF
  2225.  
  2226. ;
  2227. ; pascal OSErr GetControlDataSize(ControlHandle inControl, ControlPartCode inPart, ResType inTagName, Size *outMaxSize)
  2228. ;
  2229.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2230.         Macro
  2231.         _GetControlDataSize
  2232.             move.w              #$0014,D0
  2233.             dc.w                $AA73
  2234.         EndM
  2235.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2236.         IMPORT_CFM_FUNCTION GetControlDataSize
  2237.     ENDIF
  2238.  
  2239.  
  2240.  
  2241.  
  2242. ; ——————————————————————————————————————————————————————————————————————————————————————
  2243. ;     • ‘CDEF’ messages                                                                    
  2244. ; ——————————————————————————————————————————————————————————————————————————————————————
  2245. ; typedef SInt16                         ControlDefProcMessage
  2246.  
  2247.  
  2248. drawCntl                        EQU        0
  2249. testCntl                        EQU        1
  2250. calcCRgns                        EQU        2
  2251. initCntl                        EQU        3
  2252. dispCntl                        EQU        4
  2253. posCntl                            EQU        5
  2254. thumbCntl                        EQU        6
  2255. dragCntl                        EQU        7
  2256. autoTrack                        EQU        8
  2257. calcCntlRgn                        EQU        10
  2258. calcThumbRgn                    EQU        11
  2259. drawThumbOutline                EQU        12
  2260. ; ——————————————————————————————————————————————————————————————————————————————————————
  2261. ;     • ‘CDEF’ entrypoint                                                                    
  2262. ; ——————————————————————————————————————————————————————————————————————————————————————
  2263. ; ——————————————————————————————————————————————————————————————————————————————————————
  2264. ;     • Constants for drawCntl message (passed in param)                                    
  2265. ; ——————————————————————————————————————————————————————————————————————————————————————
  2266.  
  2267. kDrawControlEntireControl        EQU        0
  2268. kDrawControlIndicatorOnly        EQU        129
  2269. ; ——————————————————————————————————————————————————————————————————————————————————————
  2270. ;     • Constants for dragCntl message (passed in param)                                    
  2271. ; ——————————————————————————————————————————————————————————————————————————————————————
  2272.  
  2273. kDragControlEntireControl        EQU        0
  2274. kDragControlIndicator            EQU        1
  2275. ; ——————————————————————————————————————————————————————————————————————————————————————
  2276. ;     • Drag Constraint Structure for thumbCntl message (passed in param)                    
  2277. ; ——————————————————————————————————————————————————————————————————————————————————————
  2278. IndicatorDragConstraint    RECORD 0
  2279. limitRect                 ds        Rect            ; offset: $0 (0)
  2280. slopRect                 ds        Rect            ; offset: $8 (8)
  2281. axis                     ds.w    1                ; offset: $10 (16)
  2282. sizeof                     EQU *                    ; size:   $12 (18)
  2283.                         ENDR
  2284. ; typedef struct IndicatorDragConstraint * IndicatorDragConstraintPtr
  2285.  
  2286. ; typedef IndicatorDragConstraintPtr *    IndicatorDragConstraintHandle
  2287.  
  2288.     IF ¬ TARGET_OS_MAC THEN
  2289. ; ——————————————————————————————————————————————————————————————————————————————————————
  2290. ;     • QuickTime 3.0 Win32/unix notification    mechanism                                    
  2291. ; ——————————————————————————————————————————————————————————————————————————————————————
  2292. ;  Proc used to notify window that something happened to the control
  2293.  
  2294. ;   Proc used to prefilter events before handled by control.  A client of a control calls
  2295. ;   CTRLSetPreFilterProc() to have the control call this proc before handling the event.
  2296. ;   If the proc returns TRUE, the control can go ahead and handle the event.
  2297.  
  2298.  
  2299. ;
  2300. ; extern long GetControlComponentInstance(ControlHandle theControl)
  2301. ;
  2302.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2303.         IMPORT_CFM_FUNCTION GetControlComponentInstance
  2304.     ENDIF
  2305.  
  2306. ;
  2307. ; extern ControlHandle GetControlHandleFromCookie(long cookie)
  2308. ;
  2309.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2310.         IMPORT_CFM_FUNCTION GetControlHandleFromCookie
  2311.     ENDIF
  2312.  
  2313. ;
  2314. ; extern void SetControlDefProc(short resID, ControlDefProcPtr proc)
  2315. ;
  2316.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2317.         IMPORT_CFM_FUNCTION SetControlDefProc
  2318.     ENDIF
  2319.  
  2320.     ENDIF
  2321.     IF OLDROUTINENAMES THEN
  2322. ; ——————————————————————————————————————————————————————————————————————————————————————
  2323. ;     • OLDROUTINENAMES                                                                    
  2324. ; ——————————————————————————————————————————————————————————————————————————————————————
  2325. ;  Variants applicable to all controls (at least ones with text)
  2326.  
  2327. useWFont                        EQU        $08
  2328.  
  2329. inLabel                            EQU        1
  2330. inMenu                            EQU        2
  2331. inTriangle                        EQU        4
  2332. inButton                        EQU        10
  2333. inCheckBox                        EQU        11
  2334. inUpButton                        EQU        20
  2335. inDownButton                    EQU        21
  2336. inPageUp                        EQU        22
  2337. inPageDown                        EQU        23
  2338. inThumb                            EQU        129
  2339.  
  2340. kNoHiliteControlPart            EQU        0
  2341. kInLabelControlPart                EQU        1
  2342. kInMenuControlPart                EQU        2
  2343. kInTriangleControlPart            EQU        4
  2344. kInButtonControlPart            EQU        10
  2345. kInCheckBoxControlPart            EQU        11
  2346. kInUpButtonControlPart            EQU        20
  2347. kInDownButtonControlPart        EQU        21
  2348. kInPageUpControlPart            EQU        22
  2349. kInPageDownControlPart            EQU        23
  2350. kInIndicatorControlPart            EQU        129
  2351. kReservedControlPart            EQU        254
  2352. kControlInactiveControlPart        EQU        255
  2353.     ENDIF    ; OLDROUTINENAMES
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.     ENDIF ; __CONTROLS__ 
  2360.  
  2361.